This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UrlEncoder = { | |
| /** | |
| * Encode a [deeply] nested object for use in a url | |
| * Assumes Array.each is defined | |
| */ | |
| encode: function(params, prefix) { | |
| var items = []; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Array.prototype.each = function(fn, scope) { | |
| var count = 0; | |
| while(count < this.length) { | |
| fn.call(scope || window, this[count], count) | |
| count++; | |
| } | |
| }; | |
| Array.prototype.search = function(fn) { | |
| var result = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'pp' | |
| require 'logger' | |
| $LOAD_PATH << File.dirname(__FILE__) | |
| require 'proxy/base' | |
| require 'proxy/wibox_proxy' | |
| require 'sensors/reading' | |
| require 'sensors/sensor' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "rubygems" | |
| require "eventmachine" | |
| module Echo | |
| def receive_data data | |
| send_data(data) | |
| end | |
| end | |
| EM.epoll |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>JS1k, 1k demo submission</title> | |
| <meta charset="utf-8" /> | |
| </head> | |
| <body> | |
| <canvas id="c"></canvas> | |
| <script> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "rubygems" | |
| require "eventmachine" | |
| class HttpHandler < EM::Connection | |
| def initialize *args | |
| super | |
| @header = "" | |
| @status = 200 | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ConversationsController < ApplicationController | |
| before_filter :load_board | |
| def index | |
| @conversations = Conversation.all | |
| respond_to do |format| | |
| format.html # index.html.erb | |
| format.xml { render :xml => @conversations } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pre.code { background: #181818; padding: 16px; color: #F8F8F8; font-family: Consolas, Monaco,"Lucida Console"; } | |
| pre.code * { font-family: Consolas, Monaco,"Lucida Console"; } | |
| pre.code .hll { background-color: #ffffcc } | |
| pre.code .c { color: #5F5A60; font-style: italic } /* Comment */ | |
| pre.code .err { border:#B22518; } /* Error */ | |
| pre.code .k { color: #CDA869 } /* Keyword */ | |
| pre.code .cm { color: #5F5A60; font-style: italic } /* Comment.Multiline */ | |
| pre.code .cp { color: #5F5A60 } /* Comment.Preproc */ | |
| pre.code .c1 { color: #5F5A60; font-style: italic } /* Comment.Single */ | |
| pre.code .cs { color: #5F5A60; font-style: italic } /* Comment.Special */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get -y install aptitude git-core curl build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require "optparse" | |
| require "json" | |
| require "findi" | |
| def report device, mode=:text | |
| name = device.name |
OlderNewer