Skip to content

Instantly share code, notes, and snippets.


Tyler Longren tlongren

View GitHub Profile
tlongren /
Created Feb 16, 2014
AltoRouter Named Parameter Limits

You can use the following limits on your named parameters. AltoRouter will create the correct regexes for you.

*                    // Match all request URIs
[i]                  // Match an integer
[i:id]               // Match an integer as 'id'
[a:action]           // Match alphanumeric characters as 'action'
[h:key]              // Match hexadecimal characters as 'key'
[:action]            // Match anything up to the next / or end of the URI as 'action'
[create|edit:action] // Match either 'create' or 'edit' as 'action'
tlongren / index.php
Last active Aug 29, 2015
AltoRouter index.php
View index.php
header("Content-Type: text/html");
include dirname(__FILE__) . '/includes/AltoRouter.php';
$router = new AltoRouter();
/* Setup the URL routing. This is production ready. */
// Main routes that non-customers see
$router->map('GET','/', 'home.php', 'home');
tlongren / charge.php
Created Feb 16, 2014
AltoRouter charge.php
View charge.php
$customer = new Customer();
$customer_id = $match['params']['customer_id'];
if ($customer->valid_customer($customer_id) && $customer->needs_paid($customer_id)) {
tlongren / header.php
Created Apr 4, 2014
RootDip WordPress Theme Static Header Image
View header.php
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" />
tlongren / settings.js
Created Apr 5, 2014
Let's Chat settings.js
View settings.js
var config = {
// Server
host: '', // Not required
port: process.env.PORT || 5000,
// Registration
disable_registration: false,
tlongren / lets-chat-heroku-log.txt
Created Apr 6, 2014
Heroku Log from Let's Chat
View lets-chat-heroku-log.txt
2014-04-05T06:54:17.117537+00:00 app[web.1]: npm ERR! Additional logging details can be found in:
2014-04-05T06:54:17.117613+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2014-04-05T06:54:18.178863+00:00 heroku[web.1]: Process exited with status 1
2014-04-05T06:54:18.189317+00:00 heroku[web.1]: State changed from starting to crashed
2014-04-05T09:42:26.222103+00:00 heroku[web.1]: State changed from crashed to starting
2014-04-05T09:42:29.369075+00:00 heroku[web.1]: Starting process with command `npm start`
2014-04-05T09:42:32.399772+00:00 app[web.1]:
2014-04-05T09:42:32.399772+00:00 app[web.1]: > lcb@0.0.1 start /app
2014-04-05T09:42:32.399772+00:00 app[web.1]: > nodejs app.js
2014-04-05T09:42:32.399772+00:00 app[web.1]:
View gist:9b6dda8c50305cefa848
tyler@echo:~/Desktop/Git/CreativeLoot/automated-platform$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Setting the name of the VM: automated-platform_default_1400603166213_31059
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
View gist:d2cecaa75c91f6e2d34b
authorize: /home/tyler/.ssh/
- /home/tyler/.ssh/id_rsa
- map: /home/tyler/Desktop/Git/CreativeLoot/automated-platform
to: /home/vagrant/automated-platform
View gist:df6d47711c6bc0c977b3
tyler@echo:~/Desktop/Git/CreativeLoot/automated-platform$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Nothing to install or update
Generating autoload files
tlongren / windstream_iowa.txt
Created May 23, 2014
First day kids are out of school for summer. I have a business 12Mbps down & 1Mbps up account from Windstream, the only provider in my town.
View windstream_iowa.txt
tyler@echo:~$ ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=46 time=2043 ms
64 bytes from icmp_seq=2 ttl=46 time=1959 ms
64 bytes from icmp_seq=3 ttl=46 time=2028 ms
64 bytes from icmp_seq=4 ttl=46 time=1961 ms
64 bytes from icmp_seq=5 ttl=46 time=1692 ms
64 bytes from icmp_seq=6 ttl=46 time=1759 ms
64 bytes from icmp_seq=7 ttl=46 time=1806 ms
64 bytes from icmp_seq=8 ttl=46 time=1795 ms