Skip to content

Instantly share code, notes, and snippets.

View statianzo's full-sized avatar
🎯
Focusing

Jason Staten statianzo

🎯
Focusing
View GitHub Profile
@statianzo
statianzo / chat.rb
Created March 9, 2012 02:57 — forked from rkh/chat.rb
Simple Chat Application using the Sinatra Streaming API
# coding: utf-8
require 'sinatra'
set server: 'thin', connections: []
get '/' do
halt erb(:login) unless params[:user]
erb :chat, locals: { user: params[:user].gsub(/\W/, '') }
end
get '/stream', provides: 'text/event-stream' do
"MARY","PATRICIA","LINDA","BARBARA","ELIZABETH","JENNIFER","MARIA","SUSAN","MARGARET","DOROTHY","LISA","NANCY","KAREN","BETTY","HELEN","SANDRA","DONNA","CAROL","RUTH","SHARON","MICHELLE","LAURA","SARAH","KIMBERLY","DEBORAH","JESSICA","SHIRLEY","CYNTHIA","ANGELA","MELISSA","BRENDA","AMY","ANNA","REBECCA","VIRGINIA","KATHLEEN","PAMELA","MARTHA","DEBRA","AMANDA","STEPHANIE","CAROLYN","CHRISTINE","MARIE","JANET","CATHERINE","FRANCES","ANN","JOYCE","DIANE","ALICE","JULIE","HEATHER","TERESA","DORIS","GLORIA","EVELYN","JEAN","CHERYL","MILDRED","KATHERINE","JOAN","ASHLEY","JUDITH","ROSE","JANICE","KELLY","NICOLE","JUDY","CHRISTINA","KATHY","THERESA","BEVERLY","DENISE","TAMMY","IRENE","JANE","LORI","RACHEL","MARILYN","ANDREA","KATHRYN","LOUISE","SARA","ANNE","JACQUELINE","WANDA","BONNIE","JULIA","RUBY","LOIS","TINA","PHYLLIS","NORMA","PAULA","DIANA","ANNIE","LILLIAN","EMILY","ROBIN","PEGGY","CRYSTAL","GLADYS","RITA","DAWN","CONNIE","FLORENCE","TRACY","EDNA","TIFFANY","CARMEN","ROSA","CINDY","GRACE","WENDY","VICTORIA",
@statianzo
statianzo / gist:1886365
Created February 22, 2012 18:07 — forked from m0tive/gist:1884821
export google history
require 'mechanize'
require 'logger'
require 'date'
## Call:
## $ ruby export.rb <gmail> <password>
caFile = File.join(File.dirname(__FILE__), 'cacert.pem')
if not File.exists? caFile
require 'net/http'
#!/usr/bin/env ruby
git_bundles = [
"git://github.com/msanders/snipmate.vim.git",
"git://github.com/scrooloose/nerdtree.git",
"git://github.com/timcharper/textile.vim.git",
"git://github.com/tpope/vim-cucumber.git",
#"git://github.com/tpope/vim-fugitive.git",
"git://github.com/tpope/vim-git.git",
"git://github.com/tpope/vim-haml.git",
window['$'] = window['jquip'] = (function(){
var win = window,
queryShimCdn = "http://cdnjs.cloudflare.com/ajax/libs/sizzle/1.4.4/sizzle.min.js",
queryEngines = function(){ return win["Sizzle"] || win["qwery"]; },
doc = document, docEl = doc.documentElement,
scriptFns=[], load=[], sLoaded,
runtil = /Until$/, rmultiselector = /,/,
rparentsprev = /^(?:parents|prevUntil|prevAll)/,
rtagname = /<([\w:]+)/,
rclass = /[\n\t\r]/g,

Aggregate

class Ship
  def load_cargo(name)
    apply :cargo_loaded, :name => name
  end

 def paint(color)
Unhandled Exception: System.TypeLoadException: Could not load type 'System.Runtime.Versioning.TargetFrameworkAttribute' from assembly 'NuGet'.
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'System.Runtime.Versioning.TargetFrameworkAttribute' from assembly 'NuGet'.
WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v2.0.50727
Missing method .ctor in assembly /Users/jstaten/bin/NuGet.exe, type System.Runtime.Versioning.TargetFrameworkAttribute
Can't find custom attr constructor image: /Users/jstaten/bin/NuGet.exe mtoken: 0x0a000746
WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v2.0.50727
Missing method .ctor in assembly /Users/jstaten/bin/NuGet.exe, type System.Runtime.Versioning.TargetFrameworkAttribute
Can't find custom attr constructor image: /Users/jstaten/bin/NuGet.exe mtoken: 0x0a000746
@statianzo
statianzo / gist:1239653
Created September 24, 2011 18:12
Fleck -> Behavior Chain
var allSockets = new List<IWebSocketConnection>();
var server = new WebSocketServer("ws://localhost:8181");
server.Start(socket =>
{
socket.OnOpen = () =>
{
allSockets.Add(socket);
};
socket.OnClose = () =>
{
@statianzo
statianzo / about.md
Created August 11, 2011 03:34 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer