Skip to content

Instantly share code, notes, and snippets.

View icco's full-sized avatar
🏠
Working from home

Nat Welch icco

🏠
Working from home
View GitHub Profile
@icco
icco / Gemfile
Created September 13, 2017 15:59 — forked from miketheman/clouddns_to_route53.rb
Tool to migrate DNS records from Rackspace Cloud DNS to AWS Route53
source 'https://rubygems.org'
ruby '2.4.0'
gem "fog-aws"
gem "fog-rackspace"
gem "aws-sdk"
gem "pry"
@icco
icco / n.rb
Created October 27, 2013 12:18 — forked from anonymous/n.rb
require 'fileutils'
Dir.glob('/Volumes/Downloads/torrents/Naruto Shippuuden Season 13 720p/*mkv').sort.each do |f|
episode = (File.basename(f).scan /\d\d\d/).first
file_name = "/Volumes/TV/Naruto Shippuuden/Naruto Shippuuden 13x#{episode.to_i - 260}.mkv"
puts "#{episode}: #{f.inspect} => #{file_name.inspect}"
FileUtils.cp f, file_name
end
<?php
// Git the data
// http://doineedanumbrella.com/api/?zip=94103
$zip = "95032";
if (isset($_REQUEST['body'])) {
$zip = $_REQUEST['body'];
}
$json = file_get_contents("http://doineedanumbrella.com/api/?zip={$zip}");
@icco
icco / license
Created November 16, 2010 19:50 — forked from defunkt/license
MIT License Gist
#!/bin/sh -e
# Usage: license
# Prints an MIT license appropriate for totin' around.
#
# $ license > COPYING
#!/bin/sh
echo "Copyright (c) `date +%Y` Nathaniel Welch
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
<?php
/**
* @package WordPress
* @subpackage Classic_Theme
*/
if ( function_exists('register_sidebar') )
register_sidebar(array(
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '',
@icco
icco / .htaccess
Created December 21, 2009 08:04 — forked from henrik/.htaccess
pseudoweb.net .htaccess
RewriteEngine On
# Map / to /_site.
RewriteRule ^$ /_site/ [L]
# Map /x to /_site/x
RewriteCond %{REQUEST_URI} !^/_site/
RewriteRule ^(.*)$ /_site/$1
# Add trailing slash to directories without them so DirectoryIndex works.
@icco
icco / gist:193865
Created September 25, 2009 21:36 — forked from dominiek/gist:193517
One line bash twitter bot
curl -d 'track=one line' http://stream.twitter.com/track.json -uonelinebot:one.onelinebot > tweets.json 2> /dev/null & tail -f tweets.json | \
while read tweet; do echo $tweet | \
grep -E -o '"screen_name":"[[:alnum:]]+"' | cut -d '"' -f 4 | while read screen_name; do \
echo "following: $screen_name"; curl -d '' http://twitter.com/friendships/create/$screen_name.json?follow=true -uonelinebot:one.onelinebot; \
done ; \
done