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
div.pagination { | |
background-color:#F7F7F7; | |
float:left; | |
margin:1em 0 5px; | |
padding:10px; | |
width:630px; | |
} | |
div.pagination a, div.pagination span { | |
border:1px solid #CCDBE4; | |
color:#3666D4; |
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
"test=abc&check=1".split("&").inject({}) {|result, elem| t=elem.split("="); result[t[0]] = t[1]; result } | |
>> {"test"=>"abc", "check"=>"1"} |
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 'net/http' | |
class ServerProxy | |
def self.call(env) | |
if env["PATH_INFO"] =~ /^\/server_proxy/ | |
request = Rack::Request.new(env) | |
params = request.params | |
Net::HTTP.start(params["service_url"]) {|http| | |
req = Net::HTTP::Get.new(params["service_path"]) |
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
if has("folding") | |
set foldenable | |
set foldmethod=syntax | |
set foldlevel=1 | |
set foldnestmax=2 | |
set foldtext=strpart(getline(v:foldstart),0,50).'\ ...\ '.substitute(getline(v:foldend),'^[\ #]*','','g').'\ ' | |
" automatically open folds at the starting cursor position | |
" autocmd BufReadPost .foldo! | |
endif |
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
import mx.collections.ArrayCollection; | |
import mx.rpc.events.ResultEvent; | |
import com.adobe.serialization.json.JSON; //download from http://code.google.com/p/as3corelib/ | |
function initateGame(playerId):void | |
{ | |
var dataToSave = [playerId]; | |
// Point the request to the script that will handle the JSON | |
var request:URLRequest = new URLRequest( "http://localhost:8000" ); |
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
#Changing the default behavior of field Errors | |
# config/initializers/field_errors.rb | |
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
msg = instance.error_message | |
if html_tag =~ /<(input|textarea|select)[^>]+class=/ | |
class_attribute = html_tag =~ /class=['"]/ | |
html_tag.insert(class_attribute + 7, "error") | |
elsif html_tag =~ /<(input|textarea|select)/ | |
first_whitespace = html_tag =~ /\s/ |
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 sys = require("sys"); | |
var net = require("net"); | |
var http = require("http"); | |
function createTestServer(){ | |
return new testServer(); | |
}; | |
function testServer(){ | |
var server = this; |
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
/** | |
* jQuery plugin to detect clicks outside an element | |
* | |
* Copyright (c) 2010 Vesess Inc. (vesess.com) | |
* Licensed under the MIT (MIT-LICENSE.txt) licenses. | |
* | |
*/ | |
(function($){ | |
$.fn.outsideClick = function(optional_params){ |
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
/** | |
* jQuery plugin to detect clicks outside an element | |
* | |
* Copyright (c) 2010 Vesess Inc. (vesess.com) | |
* Licensed under the MIT (MIT-LICENSE.txt) licenses. | |
* | |
*/ | |
(function($){ | |
$.fn.outsideClick = function(optional_params){ |
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 my_function_expression = function(){}; | |
var mocked = nodemock.mock("foo").takes(20, my_function_expression).calls(my_function_expression, 30, [10, 20]) |