Skip to content

Instantly share code, notes, and snippets.

View aktowns's full-sized avatar
👾

Ashley Towns aktowns

👾
View GitHub Profile
#!/usr/bin/env ruby
# This script converts xccolorthemes to dtvcolorthemes for porting xcode 3.x themes to xcode 4.x
# created by ashley towns <ashleyis@me.com>
# Public domain.
# ./dvtcolorconvert <inputfile>
# spits out a .dtvcolortheme file
require 'plist'
raise "Error: need a source file #{__FILE__} [file.xccolortheme]" if ARGV.length == 0
parseInt('005')
// => 5
parseInt('006')
// => 6
parseInt('007')
// => 7
parseInt('008')
// => 0
parseInt('009')
// => 0
@aktowns
aktowns / gist:949522
Created April 30, 2011 07:51
Magic nyan-cat
javascript:i=0;setInterval(function(){i++;if(i==360){i=0;};document.getElementsByClassName('nyan-cat')[0].setAttribute("style","-webkit-transform:rotate("+i+"deg)")},50);
javascript:i=0;setInterval(function(){i++;if(i==window.document.width){i=0;};document.getElementsByClassName('nyan-cat')[0].setAttribute("style","position: absolute; left:"+i+"px");},10);
action main()
kSEARCH_URL := "http://search.twitter.com/search?q=ikeeex"
if web -> is connected then
raw_tweets := web -> download(kSEARCH_URL)
tweets := web -> json(raw_tweets)
foreach json in tweets -> field("results")
image := web->download picture (json -> field("profile_image_url)
image -> post to wall
image -> resize(32,32)
image -> update on wall
@aktowns
aktowns / gist:1008985
Created June 5, 2011 14:08
INCEPTION
;;; Lua running in Ruby running in Python running in Lisp by ashleyis@me.com
;;; TODO:
;;; Lua
;;; Javascript
;;; ???
;;; OUTPUT:
;;; ~| newlisp inception.lisp
;;; [Entered lisp state]
;;; [Entered python state]
;;; [Entered ruby state]
~| ruby -rredcloth -e 'puts RedCloth.new($<.read).to_html'
table{color: red; background: green}.
|hey there|yep|
<table style="color: red; background: green;">
<tr>
<td>hey there</td>
<td>yep</td>
</tr>
</table>
require 'httparty'
INTERNODE_USER = "@internode.on.net"
INTERNODE_PASS = ""
class Internode
include HTTParty
base_uri 'https://customer-webtools-api.internode.on.net/api/v1.5/'
@aktowns
aktowns / mrisc.rb
Created July 10, 2011 18:01 — forked from pachacamac/mrisc.rb
A Simple Assembler Language and VM
#!/usr/bin/env ruby
class MRISC
def run(code)
tokens = code.gsub(/(\*.*?\*)|[^a-z0-9,-;@\._]/,'').split(';')
@vars,stack,i = {:_pc=>-1,:_oc=>0},[],0
tokens.map!{|t| t.chars.first=='@' ? (@vars[t.to_sym]=i-1;nil) : (i+=1;t.split(',').map{|e|numeric?(e) ? e.to_i : e.to_sym})}.compact!
while @vars[:_pc] < tokens.size-1
@vars[:_pc] += 1
@vars[:_oc] += 1

Drag the text below into your bookmarks bar and click it on any webpage to make it a page of awesome.**

javascript:Array.prototype.slice.call(document.all).forEach(function(x){x.style.fontFamily='Comic Sans MS';});

** awesome not guaranteed.