Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
drinking from the firehose...

Rupak Ganguly rupakg

😎
drinking from the firehose...
View GitHub Profile
@rupakg
rupakg / text2img.rb
Created Mar 11, 2009
convert text to image
View text2img.rb
require "mini_magick"
image = MiniMagick::Image.from_file("c:\\test.jpg")
image.resize "100x100"
image.write("c:\\output.jpg")
@rupakg
rupakg / gradiantfill.rb
Created Mar 11, 2009
Create images using Magick
View gradiantfill.rb
require 'RMagick'
include magick
# Demonstrate the GradientFill class
Rows = 100
Cols = 300
Start = "#900"
End = "#000"
@rupakg
rupakg / irbrc.txt
Last active Aug 30, 2015
IRBRC settings
View irbrc.txt
.irbrc for Win32
Create a file called anything you like (e.g. “_irbrc” or “irb.rc”) and place it anywhere you like (say C:\Documents and Settings\), and set that full path to the ENV variable IRBRC, e.g. C:\Documents and Settings\\_irbrc
## Libraries
require 'rubygems'
require 'irb/completion'
require 'map_by_method'
require 'what_methods'
require 'pp'
@rupakg
rupakg / Technology Stack for Rails.textile
Created Oct 19, 2010
Various technologies that I have narrowed down for use in my Rails apps.
View Technology Stack for Rails.textile

Technology Stack for Rails

Core

  • Rails 3.0.1
  • Ruby 1.9.2 (use RVM for mgmt.)

Development

  • Bundler – manage gem dependencies
@rupakg
rupakg / Dev Gems
Created Oct 30, 2010
gemfile with dev stack
View Dev Gems
source 'http://rubygems.org'
gem 'rails', '3.0.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
#gem 'mysql2'
gem "sqlite3-ruby"
@rupakg
rupakg / Dev Gems
Created Oct 30, 2010
gemfile with dev stack
View Dev Gems
source 'http://rubygems.org'
gem 'rails', '3.0.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
#gem 'mysql2'
gem "sqlite3-ruby"
View generate_passkey.rb
require 'hmac-sha1'
require 'digest/sha1'
require 'base64'
token="-Sat, 14 Nov 2009 09:47:53 GMT-GET-/video.xml-"
private_key="whatever"
salt=Digest::SHA1.hexdigest(token)[0..19]
passkey=Base64.encode64(HMAC::SHA1.digest(private_key, salt)).strip
View coffeescript_error.coffee
Coffeescript:
masterTableView = new TableView
id:'masterView'
data:tableData
layout:'vertical'
style: Titanium.UI.iPhone.TableViewStyle.GROUPED
editable:true <=========
complies to JS:
View convert.coffee
domDocument = Titanium.XML.parseString(this.responseText)
domNodeList = domDocument.getElementsByTagName("Contents")
objectsList = [];
for (var i = 0; i < domNodeList.length; i++)
{
keyName = item.getElementsByTagName('Key').item(0).textContent;
size = objects[i].getElementsByTagName('Size').item(0).textContent;
objectsList[i] = {
key: keyName,
View example.sass
@import compass/css3
$color-light: #fff
$color-grey: #ddd
$color-dark: #000
//--------------------------------------------------------------------------------
// I started out like this, getting all
// carried away with how awesome Sass
You can’t perform that action at this time.