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 everyauth = require('everyauth') | |
, connect = require('connect'); | |
everyauth.debug = true; | |
everyauth.twitter | |
.consumerKey(XXX) | |
.consumerSecret(XXX) | |
.findOrCreateUser( function (session, accessToken, accessTokenSecret, twitterUserMetadata) { | |
console.log("at: "+accessToken+" sec: "+accessTokenSecret); |
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 everyauth = require('everyauth') | |
, connect = require('connect'); | |
everyauth.twitter | |
.consumerKey('XX') | |
.consumerSecret('XX') | |
.findOrCreateUser( function (session, accessToken, accessTokenSecret, twitterUserMetadata) { | |
return {id:twitterUserMetadata.id}; | |
}) | |
.redirectPath('/'); |
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 cluster = require('cluster'); | |
var http = require('http'); | |
run_cluster(2, function(){ | |
// Worker processes have a http server | |
console.log("running ID: "+process.env.NODE_WORKER_ID); | |
http.Server(function(req, res) { | |
res.writeHead(200); | |
res.end("hello world\n"+process.env.NODE_WORKER_ID+ new Date().toString()); |
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
#!/bin/bash | |
sudo apt-get -y install zlib1g-dev libssl-dev libreadline5-dev libyaml-dev build-essential bison checkinstall libxml2 libxml2-dev libxslt1-dev | |
cd /tmp | |
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz | |
tar xvzf ruby-1.9.2-p290.tar.gz | |
cd ruby-1.9.2-p290 | |
./configure | |
make | |
sudo make install | |
sudo gem update --system |
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
# Update System | |
echo 'System Update' | |
apt-get -y update | |
echo 'Update completed' | |
# Install help app | |
apt-get -y install libssl-dev git-core pkg-config build-essential curl gcc g++ | |
# Download & Unpack Node.js - v. 0.6.11 | |
echo 'Download Node.js - v. 0.6.11' | |
mkdir /tmp/node-install | |
cd /tmp/node-install |
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
gem 'oauth2-provider', :git => 'git@github.com:freerange/oauth2-provider.git' |
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
#!/bin/bash | |
sudo apt-get -y install zlib1g-dev libssl-dev libreadline5-dev libyaml-dev build-essential bison checkinstall libxml2 libxml2-dev libxslt1-dev git-core | |
cd /tmp | |
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz | |
tar xvzf ruby-1.9.2-p290.tar.gz | |
cd ruby-1.9.2-p290 | |
./configure | |
make | |
sudo make install | |
sudo gem update --system |
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
Caused by: org.jruby.exceptions.RaiseException: (LoadError) load error: yajl/yajl -- java.lang.UnsatisfiedLinkError: failed to load shim library, error: /var/lib/tomcat6/file:/var/lib/tomcat6/webapps/pablo/WEB-INF/lib/jruby-stdlib-1.6.7.jar!/META-INF/jruby.home/META-INF/jruby.homei386-Linux/libjruby-cext.so: cannot open shared object file: No such file or directory | |
Caused by: java.lang.UnsatisfiedLinkError: failed to load shim library, error: /var/lib/tomcat6/file:/var/lib/tomcat6/webapps/pablo/WEB-INF/lib/jruby-stdlib-1.6.7.jar!/META-INF/jruby.home/META-INF/jruby.homei386-Linux/libjruby-cext.so: cannot open shared object file: No such file or directory | |
at org.jruby.cext.Native.load(Native.java:95) | |
at org.jruby.cext.Native.getInstance(Native.java:66) | |
at org.jruby.cext.ModuleLoader.load(ModuleLoader.java:51) | |
at org.jruby.runtime.load.CExtension.load(CExtension.java:94) | |
at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:745) | |
at org.jruby.runtime.load.LoadService.smartLoad(Loa |
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
source 'https://rubygems.org' | |
gem 'rails', '3.2.1' | |
gem 'nokogiri' , '1.5.2' | |
gem 'json' | |
# Gems used only for assets and not required | |
# in production environments by default. | |
group :assets do |
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
# The Computer Language Shootout | |
# http://shootout.alioth.debian.org | |
# | |
# Optimized for Ruby by Jesse Millikan | |
# From version ported by Michael Neumann from the C gcc version, | |
# which was written by Christoph Bauer. | |
# | |
unless 2.0.respond_to? :pow | |
class Float | |
def pow(num) |