Skip to content

Instantly share code, notes, and snippets.

#!/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
<?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")
#!/bin/sh
# backs up wordpress database and files
set -e
###### set your variables
BLOGDIR="/home/username/public_html/blog" ## location of blog on server
BUDIR="/home/username/blogbu" ## location of backups on server
DBNAME='dbname' ## name of your blog's database
DBUSER='dbuser' ## database username
<?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!
@smajda
smajda / uploadimg.sh
Created October 6, 2009 13:22
OS X script for resizing and uploading images
#!/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?
@smajda
smajda / aggregate-feed.php
Created October 7, 2009 16:41
Merge multiple RSS feeds with SimplePie
<?php
/* Merge multiple RSS feeds with SimplePie
*
* Just modify the path to SimplePie and
* modify the $feeds array with the feeds you want
*
* You should probably also change the channel title, link and description,
* plus I added a CC license you may not want
*
* Help from: http://www.webmaster-source.com/2007/08/06/merging-rss-feeds-with-simplepie/
@smajda
smajda / gist:1621475
Created January 16, 2012 15:51
Add theme version option for bwp minify's cache buster
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(-)
"""
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
@smajda
smajda / gist:5388745
Created April 15, 2013 15:01
wget mirror with options I have to google for everytime.
#!/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 \