This file contains 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 UrlEncodedPairParser < StringScanner #:nodoc: | |
attr_reader :top, :parent, :result | |
def initialize(pairs = []) | |
super('') | |
@result = {} | |
pairs.each { |key, value| parse(key, value) } | |
end | |
KEY_REGEXP = %r{([^\[\]=&]+)} |
This file contains 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
Topic | |
- NoSQLite | |
- Consider 3 useful things: | |
- SQLite - SQLite is itself a great datastore because it is a | |
fast and powerful SQL database in one file and is widely | |
deployed and supported. | |
- JSON - JSON is a simple and cruft free way to describe and | |
transport objects. That is why programmers love it. There is | |
good support for it in virtually every language. | |
- HTTP - HTTP allows things to connect and talk to each other. |
This file contains 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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
This file contains 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 'eventmachine' | |
require 'net/dns' | |
require 'net/dns/resolver' | |
module EM # :nodoc: | |
module Protocols | |
include Logger::Severity | |
class AsyncResolver < Net::DNS::Resolver |
This file contains 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 perl | |
use Net::IMAP::Simple::SSL; | |
$| = 1; | |
my $server = 'imap.gmail.com'; | |
my $user = 'YOU@gmail.com'; | |
my $pass = 'PASSWORD'; | |
my $imap = Net::IMAP::Simple::SSL->new($server); | |
$imap->login($user => $pass) || die "cannot connect"; | |
my $messages = $imap->select('Inbox'); | |
my $count = 0; |
This file contains 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
var tls = require('tls'); | |
var fs = require('fs'); | |
var Buffer = require('buffer').Buffer; | |
var zlib = require('zlib'); | |
var BufferList = require('bufferlist'); | |
var Binary = require('bufferlist/binary'); | |
var Put = require('put'); | |
var http = require('http'); | |
var options = |
This file contains 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
// ========================= getStyleProperty by kangax =============================== | |
// http://perfectionkills.com/feature-testing-css-properties/ | |
var getStyleProperty = (function(){ | |
var prefixes = ['Moz', 'Webkit', 'Khtml', 'O', 'Ms']; | |
var _cache = { }; | |
function getStyleProperty(propName, element) { |
This file contains 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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains 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
# Base widget class | |
class Widget | |
@widgetClass: 'widget_base' | |
@defaults: {} | |
# Apply options and data() options to defaults hash | |
constructor: (@$element, options={}) -> | |
# The descendent constructor | |
actualConstructor = @__proto__.constructor | |
OlderNewer