This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Videos | |
Plugin URI: | |
Author: Dave Rupert | |
Author URI: http://www.daverupert.com | |
Description: A custom post type that adds videos and custom taxonomies. | |
Version: 1.0 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.host; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jekyll | |
# Compiled LESS CSS into CSS. You must specify an empty YAML front matter | |
# at the beginning of the file. | |
# .less -> .css | |
class LessConverter < Converter | |
safe true | |
priority :low | |
pygments_prefix "\n" | |
pygments_suffix "\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jekyll | |
# Compiled LESS CSS into CSS. You must specify an empty YAML front matter | |
# at the beginning of the file. | |
# .less -> .css | |
class LessConverter < Converter | |
safe true | |
priority :low | |
pygments_prefix "\n" | |
pygments_suffix "\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function sum($a, $b) | |
{ | |
return $a + $b; | |
} | |
function myfunc($input) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: $0 username | |
# e.g.: | |
# $ ./twitter_user_to_image coates | |
# https://si0.twimg.com/profile_images/1597362183/me.jpg | |
curl -sL http://twitter.com/$1 | grep profile_images | head -n1 | perl -p -e's/.*?http/http/;s/".*//;s/_bigger//' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# An example Jekyll generator. Utilizes the new plugin system. | |
# | |
# 1. Make a _plugins directory in your jekyll site, and put this class in a file there. | |
# 2. Upon site generation, version.html will be created in your root destination with | |
# # the version of Jekyll that generated it | |
module Jekyll | |
class VersionReporter < Generator | |
safe true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Suggested name for this script: git-clean-stale-branches | |
# | |
# This script will help to remove "stale" branches from a remote | |
# repository (by default the "origin" repository). Stale branches | |
# are any branches that does not exist in the local repository. | |
# | |
# This script should be run in the local repository. It will print | |
# out a git command to remove all branches from the remote repository |