Skip to content

Instantly share code, notes, and snippets.

View rupakg's full-sized avatar
😎
drinking from the firehose...

Rupak Ganguly rupakg

😎
drinking from the firehose...
View GitHub Profile
@rupakg
rupakg / .gitignore_global
Created June 27, 2011 18:36
Global gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@pengwynn
pengwynn / random_voice_abc.rb
Created August 25, 2011 21:57
First grade fun learning Ruby
voices = %w(Agnes Kathy Princess Vicki Victoria)
("a".."z").each do |letter|
`say -v #{voices.shuffle.first} "#{letter}"`
end
require "thread"
$mutex = Mutex.new
$total = 0
def incr
$mutex.synchronize { $total += 1 }
sleep
end
@rupakg
rupakg / Gemfile
Created November 12, 2011 08:14 — forked from therealadam/Gemfile
An example of how to authorize your app with Punchtab's OAuth2 API
source :rubygems
gem 'sinatra', '1.0'
gem 'oauth2'
gem 'json'
group :development do
gem 'shotgun'
end
@rietta
rietta / domain_validator.rb
Created October 4, 2012 20:51
Rails 3 Bare Domain Validator
#
# Domain Validator by Frank Rietta
# (C) 2012 Rietta Inc. All Rights Reserved.
# Licensed under terms of the BSD License.
#
# To use in a validation, add something like this to your model:
#
# validates :name, :domain => true
#
class DomainValidator < ActiveModel::EachValidator
@mkdynamic
mkdynamic / Rakefile
Last active December 10, 2015 11:09 — forked from jenslukowski/Rakefile
Including MailCore for RubyMotion project.
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'HelloMailCore'
# Configure MailCore
app.vendor_project("vendor/MailCore", :xcode, :headers_dir => "{../include,libetpan/build-mac/.build/include/libetpan}", :target => "MailCore iOS")
@aaronksaunders
aaronksaunders / parse_fb_appcelerator.js
Created May 8, 2013 21:54
UPDATED FIX AVAILABLE HERE: http://bit.ly/1oaipIo Trying to create and link a facebook user to parse using appcelerator titanium. This solution listed below works BUT the question was removed from the Parse QA forum because I am using an undocumented method from an open source javascript library... don't quite understand that, but I am looking f…
// setting auth data retrieved from Ti.Facebook login
authData = {
"facebook" : {
"id" : Ti.Facebook.uid,
"access_token" : Ti.Facebook.accessToken,
"expiration_date" : expDate, // "format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
}
};
// Either way I resolved the problem, calling _handleSaveResult(true) on the returned user object,
@StefanH
StefanH / install_ruby.sh
Last active December 23, 2015 00:09
install ruby on precise64 vagrant box
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p429.tar.gz
tar -xvzf ruby-1.9.3-p429.tar.gz
cd ruby-1.9.3-p429/
./configure --prefix=/usr/local
make
make install
# DOCKER-VERSION 0.6.4
# 13.10 - 04 has a missing ppa for postgresql 9.2 at the moment (26/10/2013)
FROM ubuntu:12.10
MAINTAINER Sam Saffron "https://twitter.com/samsaffron"
RUN apt-get -y update &&\
apt-get -y upgrade &&\
apt-get -y install software-properties-common &&\