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
post '/upload' do | |
# This accepts the XHR uploads and save the file into the script home directory | |
string_io = request.body # will return a StringIO | |
data_bytes = string_io.read # read the stream as bytes | |
filename = env['HTTP_X_FILE_NAME'] # This will be the actual filename of the uploaded file | |
# Write it to disk... |
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
// ========================================================================== | |
// Project: Jaysprout | |
// Copyright: ©2011 My Company, Inc. | |
// ========================================================================== | |
/*globals Jaysprout */ | |
var Jaysprout = SC.Application.create(); | |
Jaysprout.Clip = SC.Object.extend({ | |
title: null, |
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
source 'http://rubygems.org' | |
gem 'rails', '3.0.6' | |
gem 'warden' # Rack authentication, required by devise | |
gem 'devise', :git => 'https://github.com/plataformatec/devise.git', | |
:branch => 'master' | |
# Authentication gem, need the 1.2 version from | |
# github to make the omniauth integration work | |
gem 'oa-oauth', :require => 'omniauth/oauth' # Authentication gem |
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
#! /bin/bash | |
# | |
# xvfb Start/Stop Xvfb server. | |
# | |
# chkconfig: 345 91 10 | |
# description: Xvfb is a virtual framebuffer X server. Xvfb is an X server that can run on machines with no display hardware and no physical input devices. | |
# processname: xvfb | |
# pidfile: ~/xvfb_${DISPLAY:1}.pid | |
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
DISPLAY=:99.0 firefox http://example.org | |
# For kicks, you can make a screenshot to see it working | |
xwd -root -display :99.0 -out screenshot.xwd | |
convert screenshot.wxd ~/screenshot.jpg | |
# Exit SSH session and download the | |
# screenshot to your local computer via SCP: | |
exit | |
scp -i yourkeypairfile.pem [email protected]:screenshot.jpg screenshot.jpg |
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
// bajs |
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
// ==UserScript== | |
// @name BetterTATMIN | |
// @namespace http://tat.se | |
// @version 0.0.1 | |
// @description Fixes some annoyances of the time reporting tool to make it nicer. | |
// @include http://www01mmxlabvm/* | |
// @copyright 2011, RIM TAT AB | |
// ==/UserScript== | |
var ENABLE_FREE_FRIDAYS = true; |
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
var Db = require('mongodb').Db; | |
var Connection = require('mongodb').Connection; | |
var Server = require('mongodb').Server; | |
var BSON = require('mongodb').BSON; | |
var ObjectID = require('mongodb').ObjectID; | |
exports.index = function(req, res) { | |
this.db = new Db('node-hipchat-logger', | |
new Server('localhost', 27017, {auto_reconnect: true}, {})); |
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
'Graph request succeeds': when(FacebookProvider, { | |
get_me_called_with: 'fbtoken99887755', | |
should_return: { | |
id: '640798226', | |
name: 'Mattias Petter Johansson' | |
}, | |
after_calling: { |
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
From: http://api.geonames.org/findNearbyPlaceNameJSON?lat=56.8134071&lng=12.6718877&username=demo | |
{ | |
geonames:[ | |
{ | |
countryName:"Sweden", | |
adminCode1:"06", | |
fclName:"city, village,...", | |
countryCode:"SE", | |
lng:12.65, | |
fcodeName:"populated place", |