Skip to content

Instantly share code, notes, and snippets.

@wengzilla
wengzilla / wheel_of_fortune.rb
Created January 6, 2014 05:23
Wheel of Fortune analysis of Bonus Round answers.
require 'nokogiri'
require 'open-uri'
class Analyzer
attr_accessor :frequency_table
def initialize
@frequency_table = Hash.new(0)
end
@wengzilla
wengzilla / gist:7000289
Created October 15, 2013 23:33
Ruby script to download SSL certificates for Windows machines.
# Script written by Fletcher Nichol (fnichol)
require 'net/http'
# create a path to the file "C:\RailsInstaller\cacert.pem"
cacert_file = File.join(%w{c: RailsInstaller cacert.pem})
Net::HTTP.start("curl.haxx.se") do |http|
resp = http.get("/ca/cacert.pem")
if resp.code == "200"
@wengzilla
wengzilla / du.ino
Created September 15, 2013 13:36
Arduino file for dino 0.10.0 gem.
#include <Servo.h>
bool debug = false;
int index = 0;
char messageBuffer[12];
char cmd[3];
char pin[3];
char val[4];
require 'yaml'
file_data = YAML.load_file('shipping.yaml')
class ShippingData
def initialize(attr={})
@sd_data = attr
end
@wengzilla
wengzilla / titleize.js
Created July 11, 2012 14:31
titlelize.js - wengzilla
String.prototype.titleize = function() {
var words = this.split(" ")
var word_count = words.length
for(var i = 0; i < word_count; i++)
if(i == 0 || !is_article(words[i]))
words[i] = words[i].capitalize()
return words.join(" ");
}
$.ajax({
type: "GET",
dataType: "jsonp",
url: url,
data: { access_token: "#{data[0].token}", count: 30 },
success: (response) ->
objects = response.data
for object in objects
# console.log JSON.stringify(object.images.low_resolution)
$(".carousel-inner").append("<div class='item' data-image='#{JSON.stringify(object.images.low_resolution)}'><img src='#{object.images.low_resolution.url}'></img></div>")
@wengzilla
wengzilla / sign_out.html
Created June 17, 2012 02:35
sign_out.html
<!DOCTYPE html>
<html>
<head>
<title>ThinAuth</title>
<link href="/assets/application-7270767b2a9e9fff880aa5de378ca791.css" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/application-990a4cf0df42934fcc4c14aaf88b7ced.js" type="text/javascript"></script>
<meta content="authenticity_token" name="csrf-param" />
<meta content="Qo7foQ9NAWhRPu+TieAboDBCeiEDLghj/m4amIgJcUc=" name="csrf-token" />
</head>
TEST TWO!!!