Discover gists
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
github = GitHub.new | |
gist = github.create_application('gist') | |
gist.make_most_awesome_paste_site! |
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 ruby | |
require "rubygems" | |
require "uv" | |
class Hilite | |
BGCOLORS = {"all_hallows_eve" => {:bg => '#000000', :fg => '#ffffff'}, | |
"amy" => {:bg => '#200420', :fg => '#d1d0ff'}, | |
"blackboard" => {:bg => '#0d1021', :fg => '#f8f8f8'}, | |
"brilliance_black" => {:bg => '#0d0d0d', :fg => '#cccccc'}, | |
"brilliance_dull" => {:bg => '#0a0a0a', :fg => '#cdcdcd'}, |
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
#marginInset { | |
margin: 15px; | |
border: medium solid white | |
} |
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
%% @author Masahito Ikuta <cooldaemon@gmail.com> [http://d.hatena.ne.jp/cooldaemon/] | |
%% @copyright Masahito Ikuta 2008 | |
%% @doc UDP Server Behaviour. | |
%% Copyright 2008 Masahito Ikuta | |
%% | |
%% Licensed under the Apache License, Version 2.0 (the "License"); | |
%% you may not use this file except in compliance with the License. | |
%% You may obtain a copy of the License at | |
%% |
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 Default | |
def add ; action( :create ) and redirect( paths.show ) ; end | |
def update | |
action( :update, name ) and redirect( resource( :site ).paths.main ) | |
end | |
def delete | |
action( :delete, name ) and redirect( resource( :site ).paths.main ) | |
end | |
def edit ; action( :find, name ) and render( :editor ) } ; end | |
def show ; action( :find, name ) and render( :show ) ; end |
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
em httpclient | |
POST /messages/create HTTP/1.1 | |
Content-length: 125 | |
Host: localhost:3333 | |
Authorization: Basic cGVuZ3VpbjpwbTMwMDI= | |
User-agent: Ruby EventMachine | |
Content-type: application/x-www-form-urlencoded | |
firefox |
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
"\e[B": history-search-forward | |
"\e[A": history-search-backward |
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
// ========================================================================== | |
// Welcome | |
// ========================================================================== | |
Welcome = SC.Object.create({ | |
// This will create the server for your application. Add any namespaces | |
// your model objects are defined in to the prefix array. | |
server: SC.Server.create({ prefix: ['Welcome'] }), | |
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 ruby | |
require 'net/http' | |
require 'uri' | |
require 'rubygems' | |
require 'json' | |
require 'pp' | |
url = 'http://www.apple.com/retail/iphone/feeds/3g_us_inv.json' | |
json = Net::HTTP.get_response(URI.parse(url)).body |
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 ruby | |
require 'net/http' | |
require 'uri' | |
require 'rubygems' | |
require 'json' | |
require 'pp' | |
url = 'http://www.apple.com/retail/iphone/feeds/3g_us_inv.json' | |
json = Net::HTTP.get_response(URI.parse(url)).body |