# Awesome Blog Post
Here is an example post to show how to use the new `excerpt` tag.
The excerpt tag provides a quick and easy way to tease a post by exposing only the first paragraph such as on a blog index page.
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 | |
$lines = explode( "\n", file_get_contents( 'input.csv' ) ); | |
$headers = str_getcsv( array_shift( $lines ) ); | |
$data = array(); | |
foreach ( $lines as $line ) { | |
$row = array(); | |
foreach ( str_getcsv( $line ) as $key => $field ) |
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
Markdown Example | |
=============== | |
This is the raw markdown used to generate the below web content. | |
Bulleted List | |
------------- | |
* Foo | |
* Bar |
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
# Bulk convert shapefiles to geojson using ogr2ogr | |
# For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/ | |
# Note: Assumes you're in a folder with one or more zip files containing shape files | |
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere) | |
#geojson conversion | |
function shp2geojson() { | |
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp" | |
} |
Here's an example of how to embed a Gist on GitHub Pages:
{% gist 5555251 %}
All you need to do is copy and paste the Gist's ID from the URL (here 5555251
), and add it to a gist
tag surrounded by {%
and %}
.
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 | |
//absolute path to wp-load.php, or relative to this script | |
//e.g., ../wp-core/wp-load.php | |
include( 'trunk/wp-load.php' ); | |
//grab the WPDB database object, using WP's database | |
//more info: http://codex.wordpress.org/Class_Reference/wpdb | |
global $wpdb; |
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
org="whitehouse" | |
for repo in $(curl -v -s "https://api.github.com/orgs/$org/repos?per_page=100&type=sources" 2>&1 | grep '"full_name": "*"' | cut -d':' -f2 | sed s'/,$//' | sed s'/"//g' ); do | |
filename=$(echo "$repo" | cut -d'/' -f2) | |
echo "Downloading $repo..." | |
curl -o "$filename.zip" -L "https://github.com/$repo/archive/master.zip" | |
done |
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
# regex to match government emails. Should detect: | |
# foo.gov, foo.mil | |
# foo.gov.uk, foo.mil.uk | |
# foo.fed.us | |
# foo.govt.nz, foo.gc.ca, foo.guv.ro, gub.uy | |
# note: foo.gouvt, foo.gc, foo.fed.uk, etc. will technically pass, but they are invalid domains | |
regex = /(\.g[ou]{1,2}(v|b|vt)|\.mil|\.gc|\.fed)(\.[a-z]{2})?$/i |
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
-- List of app store apps to install, if not installed | |
-- Name must exactly match name as it appears on the "Purchased" tab of the App Store | |
set myApps to {"Chroma for Hue", "Pushbullet", "Thessa", "TweeDeck by Twitter", "Calca", "Gif Brewery", "Twitter"} | |
-- via http://stackoverflow.com/a/3469708 | |
on FileExists(theFile) -- (String) as Boolean | |
tell application "System Events" | |
if exists file theFile then | |
return true | |
else |
NewerOlder