Blog Posts

Making a simple HTTP server with sockets thumbnail

Making a simple HTTP server with sockets

In this blog post, we’ll set up a very simple Unix HTTP server in C using sockets. This tutorial covers opening the socket for the server, along with writing the HTTP response.

October 15, 2017 - simple, sockets, server, http, c

Writing a tic-tac-toe solver using minimax thumbnail

Writing a tic-tac-toe solver using minimax

In this post, we'll build a tic-tac-toe solver in Python, using the minimax algorithm. We'll go through constructing a game tree, but we won't add alpha-beta pruning.

September 6, 2017 - minimax, tic-tac-toe, solver, artificial intelligence

Getting started with WebSockets in Tornado thumbnail

Getting started with WebSockets in Tornado

In this article, we build a simple application using WebSockets with the Tornado platform. The application sends messages to multiple connected clients.

August 22, 2017 - tornado, python, websockets, simple

How to SSH tunnel to a Docker container on a remote server thumbnail

How to SSH tunnel to a Docker container on a remote server

If you're running a web server in a Docker container on a remote server, you might want to map a port on your computer to the web server within the Docker container. This tutorial breaks down the process into two steps.

May 4, 2017 - docker, ssh tunnel, port forward, forwarding, container

Adding GitHub to Your Hosts File thumbnail

Adding GitHub to Your Hosts File

Sometimes you need to access GitHub directly from its IP address. For example, on Oct. 21, the Dyn DNS service went out, and GitHub's domain no longer resolved to the IP. This tutorial walks you through editing your hosts file.

October 21, 2016 - hosts, dns, github, dyn, outage

Setting up Flask with Red Hat on AWS thumbnail

Setting up Flask with Red Hat on AWS

Setting up Flask varies depending on the operating system. In this example, I walk through how to set up an Apache server, and then a Flask server in Python on Red Hat Enterprise Linux (RHEL). The same principles apply to other Linux distros.

October 16, 2016 - flask, red hat, rhel, python, aws

How to get MacTeX faster: Easily using BasicTeX thumbnail

How to get MacTeX faster: Easily using BasicTeX

LaTeX, and the macOS distribution MacTeX, can save you a significant amount of time, but the MacTeX download is huge. BasicTeX is a lightweight alternative that offers many of the same benefits. You can easily get started with this tutorial.

April 15, 2016 - basictex, mactex, latex, install

Accessing AWS Elastic Beanstalk through macOS Finder thumbnail

Accessing AWS Elastic Beanstalk through macOS Finder

While SSH and the EB CLI are fast, sometimes you want visual feedback when accessing your EC2 instance with Elastic Beanstalk. Using sshfs, you can access the EC2 filesystem and mount it onto your local machine, despite having an unreliable IP address.

April 15, 2016 - elastic beanstalk, finder, sshfs, amazon web services, ssh

Using custom domains with AWS Elastic Beanstalk thumbnail

Using custom domains with AWS Elastic Beanstalk

When configuring Amazon Web Services, Elastic Beanstalk is a great option. At the same time, you don't want to pay an absurd amount for emails or HTTPS. In this tutorial, we find an affordable way to seamlessly forward emails and redirect users to your site.

April 14, 2016 - elastic beanstalk, amazon web services, custom domain, route 53, email forwarding

Evaluating a string as a mathematical expression in JavaScript thumbnail

Evaluating a string as a mathematical expression in JavaScript

Sometimes it is necessary to parse a string in JS as an equation. While eval() provides quick results, it is often dangerous. Instead, in this tutorial we explore the process of parsing a string with vanilla JavaScript, using the basic order of operations.

February 17, 2015 - javascript, math, parse equation, mathematical string

Simple Facebook PHP SDK 4 tutorial thumbnail

Simple Facebook PHP SDK 4 tutorial

The Facebook SDK 4 documentation for PHP is vague and doesn't fully explain how to get started. With this tutorial you'll use the Facebook SDK and gain an understanding of how to get data you need. In the example we fetch the user's most recent photo.

July 8, 2014 - facebook sdk, php, tutorial, sdk 4, simple, example, permissions

Scraping the web with PHP thumbnail

Scraping the web with PHP

So many websites fail to provide developers with APIs, and those that do sometimes neglect to update them. One of the ways to get the data that you need is by directly scraping the HTML files themselves. This is accomplished with PHP, cURL and the HTML DOM.

May 18, 2014 - web scraping, php, indexing, web harvesting, search spider, big data

Using cURL in PHP thumbnail

Using cURL in PHP

There are plenty of ways to get the response from a server in PHP. If you want the flexibility of sending POST data and easy error reporting, cURL is the way to go. This method is especially useful when working with APIs or sending data to an external form.

April 28, 2014 - cURL, fetch, php, fopen, api

Making pretty calendars with jQuery thumbnail

Making pretty calendars with jQuery

Calendars are tricky. While you definitely need a robust calendar, an attractive design can leave a lasting impression on a user. With jQuery and the plugin Pretty Calendar, you can easily generate beautiful calendars in just a few logical lines of code.

April 19, 2014 - jquery, calendar, prettycalendar, javascript calendar, flexible

Designing elastic layouts with CSS thumbnail

Designing elastic layouts with CSS

While the most important design consideration is generally usability, it initially seems like it is too exhausting to maintain a solid elastic or fluid layout. With a few tricks and CSS rules, however, we can make the maintenance of elastic designs a piece of cake.

April 12, 2014 - fluid, elastic, layout, CSS

What is the best time to post on Facebook? thumbnail

What is the best time to post on Facebook?

The most effective way of getting more likes is to post when your audience is active. This Chrome extension tracks how many of your Facebook friends are active and generates a graph of the results. You can easily see trends and time your posts accordingly.

April 5, 2014 - best time to post, facebook, what is the best time, most users active

Getting the source code of a site on your phone thumbnail

Getting the source code of a site on your phone

On mobile devices, getting the source code of a website is often excessively difficult. Using PHP for the server side code and a Javascript bookmarklet, we can make the process much easier. You can use the same code to create your own bookmarklets.

April 1, 2014 - mobile, source code, php, fetch website, bookmarklet

Fetching XML online and parsing in Objective C thumbnail

Fetching XML online and parsing in Objective C

Frequently we need to get data online in iOS development. When working with XML especially, it's often useful to have your own parsing algorithm. This post demonstrates how we can format online data in an iOS app, using the Lettuce app as an example.

March 29, 2014 - xml, parse, fetch, objective c, ios, iphone

Building the Lettuce app thumbnail

Building the Lettuce app

The UITableView is fairly easy to use and customize through XCode. But sometimes more detailed customization is necessary for each cell. By implementing the UITableViewCell class we can make cells look exactly as we want them with Objective C.

March 29, 2014 - lettuce, uitableview, uitableviewcell, custom table, ios, iphone

Displaying code on your website thumbnail

Displaying code on your website

Numbering lines and displaying code on your website can be tricky. With the help of CSS and a few JS libraries we can easily present inline or block code on a website. We use Prettify and jQuery to style our code and automatically escape HTML tags when necessary.

March 28, 2014 - jquery, pretty-print, pre tag, code

Creating a Reddit front page generator thumbnail

Creating a Reddit front page generator

A walkthrough of the code behind Apptic's front page generator for Reddit. Using PHP and jQuery, this tutorial constructs a simple proxy. The PHP code to get the response from a server has multiple uses; often cross domain requests are not allowed with Javascript alone.

March 27, 2014 - php, proxy, fetch website, jquery fetch

Page 1 - 4

All code that is referenced or shown in this blog is covered under the MIT License unless otherwise stated.