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
# encoding: utf-8
require 'iconv'
ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')
questions = []
print "Starting.."
Dir['*.txt'].each do |file|
print "."
questions << ic.iconv(File.open(file).read).downcase.split("\n")
end

remove wikipedia blackout..

Copy below to your bookmarks bar, drag drop etc javascript:$("div").css('display','block');$("#mw-sopaOverlay").css('display','none')

{
"files":
{
"bootstrap": "https://raw.github.com/twitter/bootstrap/master/bootstrap.min.css",
"coffeescript": "https://raw.github.com/jashkenas/coffee-script/master/extras/coffee-script.js",
"jquery": "http://code.jquery.com/jquery.min.js",
"task.js": "https://raw.github.com/mozilla/task.js/master/lib/task.js",
"underscore": "http://documentcloud.github.com/underscore/underscore-min.js"
},
"packages":

rmate via ssh tunnel

on the client (texmate box) run the following

ssh -R 52698:localhost:52698 [target host or ip]

or

add the following to your ssh config entry inside a Host block

RemoteForward 52698 localhost:52698

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.

@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
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/'
~| 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>
@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]
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