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 | |
set -e | |
workdir='~/Downloads'; | |
latest=`curl -L -s http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/LATEST` | |
cd $workdir; | |
curl -L http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/$latest/chrome-mac.zip -o $workdir/chrome-mac-latest.zip |
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 | |
// Appends a "View original at http://yourwpblog" link to end of post content | |
// in WordPress RSS feeds | |
function append_to_feed($postContent) { | |
global $post; | |
// append the link to the post content | |
$postContent .= '<p>(<a href="'.get_permalink().'">View original at '.get_bloginfo('url').'</a>)</p>'; |
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 | |
// Adds Creative Commons license to WordPress RSS feeds | |
// Modify this for your site & license | |
$feed_license = array( | |
"moduleNamespace" => 'xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"', | |
"ccNamespace" => 'xmlns:cc="http://creativecommons.org/ns#"', | |
"link" => "http://creativecommons.org/licenses/by-nc-sa/3.0/", | |
"ccName" => "Creative Commons BY-NC-SA", | |
"years" => '2003-'.date("Y") |
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 | |
// Takes twitter RSS feed, strips the "username: ", removes @replies & | |
// auto-hyperlinks links | |
// by Jon Smajda: | |
// http://jon.smajda.com/blog/2008/07/24/customizing-twitter-rss-with-simplexml/ | |
// get twitter username, 'smajda' is default | |
$username=$_GET["username"]; // request any username with '?username=' | |
if ( empty($username) ) { | |
$username='smajda'; // <-- change this to your username! |
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 | |
# A script for resizing images (using OS X's sips), uploading to a server | |
# and pasting HTML code to your (OS X) clipboard. | |
# If you haven't guessed, it requires OS X. | |
# more info: | |
# http://jon.smajda.com/blog/2008/04/12/image-upload-script/ | |
set -e | |
####### set all your variables | |
imagedir="/tmp" # which local dir should images be saved to? |
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
From 46e9890ead9e23600df5d081e78817e2889eddf2 Mon Sep 17 00:00:00 2001 | |
From: Jon Smajda <jon@smajda.com> | |
Date: Mon, 16 Jan 2012 09:36:32 -0600 | |
Subject: [PATCH] Add theme version as option for bwp-minify | |
--- | |
.../bwp-minify/includes/class-bwp-minify.php | 8 +++++++- | |
1 files changed, 7 insertions(+), 1 deletions(-) |
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
set bind-tty-special-chars off | |
"\e[1~": beginning-of-line | |
"\e[4~": end-of-line | |
"\e[5~": beginning-of-history | |
"\e[6~": end-of-history | |
"\e[3~": delete-char | |
"\e[2~": quoted-insert | |
"\e[5C": forward-word | |
"\e[5D": backward-word | |
"\e\e[C": forward-word |
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
""" | |
Converts source video files in `sources` to mp4, ogv, and webm 640x360. | |
Edit `sources` (list of filenames) and adjust `source_dir`, `output_dir`, | |
and `new_path` as needed. | |
Reference: http://paulrouget.com/e/converttohtml5video/ | |
""" | |
import os | |
import subprocess |
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 | |
url='http://someurl.com/' | |
wait=2 # wait between each request | |
cutdirs=2 # i.e. if '/foo/bar/data' -> start at 'data' | |
wget \ | |
--execute="robots=off" \ | |
--mirror \ | |
--convert-links \ |
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
from textwrap import dedent | |
def beer_song(): | |
def describe(quantity): | |
if quantity > 1: | |
return '{} bottles'.format(quantity) | |
elif quantity == 1: | |
return '1 bottle' | |
else: | |
return 'No more bottles' |
OlderNewer