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
/***************************************** | |
/* DOM touch support module | |
/*****************************************/ | |
if (!window.CustomEvent) { | |
window.CustomEvent = function (event, params) { | |
params = params || { bubbles: false, cancelable: false, detail: undefined }; | |
var evt = document.createEvent('CustomEvent'); | |
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); | |
return evt; | |
}; |
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
(function (exports) { | |
/** | |
* Dependencies | |
* - jsbn.js | |
* - jsbn2.js | |
* - prng4.js | |
* - ec.js | |
* - sec.js | |
* - rng.js |
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 -w | |
# brew-services(1) - Easily start and stop formulas via launchctl | |
# =============================================================== | |
# | |
# ## SYNOPSIS | |
# | |
# [<sudo>] `brew services` `list`<br> | |
# [<sudo>] `brew services` `restart` <formula><br> | |
# [<sudo>] `brew services` `start` <formula> [<plist>]<br> |
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
// Copyright (c) 2013 Amanieu d'Antras | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |
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
// Make sure the socket is coming from our app by matching the session id | |
socketServer.set('authorization', function (data, accept) { | |
cookieParser(data, {}, function(err) { | |
if (err) { | |
accept(err, false); | |
} else { | |
config.sessionStore.load(data.signedCookies[config.sessionKey], function(err, session) { | |
if (err || !session) { | |
accept('Session error', false); | |
} else { |
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 'rack' | |
## | |
# Tries to calculate size of the complete response. | |
# This middleware should be chained in front of everything else. | |
# Middleware taking care of compression, etag handling etc could | |
# produce wrong results. | |
# | |
# Leaves streaming intact and does work file bodies from sockets | |
# and files. |
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 "datamapper" | |
DataMapper.setup(:default, "sqlite::memory:") | |
DataMapper::Logger.new(STDOUT, :debug) | |
class Recipe | |
include DataMapper::Resource | |
property :id, Serial |
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
<?php | |
class item { | |
public $player_id, $ids, $sql, $vars = array(); | |
private $functions = array(); | |
function __construct($sql=null) { | |
$this->sql = $sql; | |
$this->sql->query('SHOW FIELDS FROM items'); | |
for($x=0;$x<$this->sql->rows;$x++) { | |
$this->sql->fetch($x); |
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
# I turned the script into a Ruby gem. To install it, first install Rubygems if you haven't already. Instructions are here: https://rubygems.org/pages/download. Next type: sudo gem install trades | |
# | |
# To run the script type: | |
# trades | |
# | |
# Or if you only want to see trades from specific exchanges: | |
# trades mtgoxUSD thUSD britcoinGBP | |
# | |
# You can specify as many exchanges as you want. Just make sure you use the same name Bitcoincharts uses. | |
# |
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 User | |
include DataMapper::Resource | |
property :id, Serial | |
property :username, String, :required => true, :unique => true | |
property :address_street_address, String | |
property :address_location, String | |
property :address_subdivision, String | |
property :address_country, String |