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
// | |
// Usage: require('./pid')("myapp"); | |
// | |
var fs = require('fs'); | |
module.exports = function(appname){ | |
process.title = appname; | |
var PID_FILE = "/usr/local/var/run/"+process.title+".pid"; |
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 EventEmitter | |
constructor: -> | |
@events = {} | |
emit: (event, args...) -> | |
return false unless @events[event] | |
listener args... for listener in @events[event] | |
return true | |
addListener: (event, listener) -> |
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
express = require "express" | |
crypto = require "crypto" | |
user = require "./src/user" | |
project = require "./src/project" | |
app = express.createServer() | |
app.listen 8008 | |
app.get '/', (req, res) -> | |
res.write JSON.stringify {version:0.3} | |
res.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
/** @jsx React.DOM */ | |
var MyRootComponent = React.createClass({ | |
getInitialState: function() { | |
return {perMinute: '-', perDay: '-'}; | |
}, | |
componentDidMount: function() { | |
var socket = io.connect(this.props.url); | |
socket.on('business.clickout', this.setState.bind(this)); | |
}, | |
render: function() { |
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
frontend front_http_plain | |
mode http | |
default_backend bck_http_plain | |
acl too_fast fe_sess_rate ge 10 | |
acl bursts_inclined path_beg -i /client1 | |
tcp-request inspect-delay 1000ms | |
tcp-request content accept unless bursts_inclined too_fast |
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
merge = (xs...) -> | |
if xs?.length > 0 | |
tap {}, (m) -> m[k] = v for k, v of x for x in xs | |
tap = (o, fn) -> fn(o); o | |
console.log merge {foo: '1', bar: 'baz'}, {bar: 'bis'} , {wombat: 'fishpaste'} | |
### | |
{ foo: '1', bar: 'bis', wombat: 'fishpaste' } |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<title>Stripe Getting Started Form</title> | |
<!-- The required Stripe lib --> | |
<script type="text/javascript" src="https://js.stripe.com/v2/"></script> | |
<!-- jQuery is used only for this example; it isn't required to use Stripe --> |
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
# oh-my-zsh location | |
ZSH=$HOME/.oh-my-zsh | |
# Use lambda theme | |
ZSH_THEME="robbyrussell" | |
# Use plugins for typical tools | |
plugins=(brew git) | |
# Load oh-my-zsh |
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
'use strict'; | |
var CLIENT_ID = 'CLIENT ID'; | |
var API_KEY = 'YOUR SECRET API KEY (Test or Live)'; | |
var TOKEN_URI = 'https://connect.stripe.com/oauth/token'; | |
var AUTHORIZE_URI = 'https://connect.stripe.com/oauth/authorize'; | |
var qs = require('querystring'); | |
var request = require('request'); |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; | |
namespace LinguisticTagger | |
{ | |
// The UIApplicationDelegate for the application. This class is responsible for launching the | |
// User Interface of the application, as well as listening (and optionally responding) to |
OlderNewer