Skip to content

Instantly share code, notes, and snippets.

View tlongren's full-sized avatar
🎯
Focusing

Tyler Longren tlongren

🎯
Focusing
View GitHub Profile
@tlongren
tlongren / help.md
Created February 16, 2014 19:30
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
tlongren / functions.php
Last active October 11, 2018 15:11
Auto Get Schema Type By Post Type
<?php
function html_tag_schema() {
$schema = 'http://schema.org/';
// Is single post
if(is_single()) {
$type = "Article";
}
// Is author page
@tlongren
tlongren / speedtest-simple.sh
Last active October 27, 2020 02:57
Speedtest.net logger
#!/bin/bash
OUTPUT=`speedtest-cli --simple --share`
echo -e "$OUTPUT\n$RIGHTNOW\n#############\n" >> st_results_simple
@tlongren
tlongren / header.php
Created April 4, 2014 00:10
RootDip WordPress Theme Static Header Image
<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="" />
</a>
@tlongren
tlongren / settings.js
Created April 5, 2014 19:05
Let's Chat settings.js
var config = {
// Server
host: '', // Not required
port: process.env.PORT || 5000,
// Registration
disable_registration: false,
// HTTPS
@tlongren
tlongren / lets-chat-heroku-log.txt
Created April 6, 2014 01:21
Heroku Log from Let's Chat
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]:
@tlongren
tlongren / sendit.md
Last active April 12, 2019 16:05
How To Send a Pull Request

##How To Send a Pull Request on GitHub

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
@tlongren
tlongren / og.html
Created May 13, 2014 18:59
Open Graph Protocol Markup
<meta property="og:title" content="" /> <!-- post/page title -->
<meta property="og:type" content="" /> <!-- post/page type -->
<meta property="og:image" content="" /> <!-- post/page image -->
<meta property="og:url" content="" /> <!-- post/page url -->
<meta property="og:description" content="" /> <!-- post/page description -->
<meta property="og:site_name" content="" /> <!-- Site Name -->
@tlongren
tlongren / functions.php
Last active September 24, 2018 13:48
Add Open Graph Markup to WordPress Theme
<?php
function add_opengraph_markup() {
if (is_single()) {
global $post;
if(get_the_post_thumbnail($post->ID, 'thumbnail')) {
$thumbnail_id = get_post_thumbnail_id($post->ID);
$thumbnail_object = get_post($thumbnail_id);
$image = $thumbnail_object->guid;
} else {
// set default image
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