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
| class Cat | |
| def self.speak # this is a class method | |
| puts "Meow" | |
| end | |
| end | |
| class Lion < Cat | |
| def roar | |
| puts "Roar Roar !!!!" #now this is just an ordinary method. |
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
| require 'rubygems' | |
| require 'hornetseye_ffmpeg' | |
| require 'hornetseye_xorg' | |
| require 'hornetseye_alsa' | |
| include Hornetseye | |
| input = AVInput.new 'sintel.mp4' | |
| alsa = AlsaOutput.new 'default:0', input.sample_rate, input.channels | |
| audio_frame = input.read_audio | |
| X11Display.show 600, :output => XVideoOutput do |display| | |
| img = input.read |
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
| framework 'Cocoa' | |
| framework 'QuartzCore' | |
| class NSColor | |
| def toCGColor | |
| colorRGB = self.colorUsingColorSpaceName NSCalibratedRGBColorSpace | |
| components = Array.new(4){Pointer.new(:double)} | |
| colorRGB.getRed components[0], green:components[1], blue:components[2], alpha:components[3] |
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
| require 'open-uri' | |
| require 'nokogiri' | |
| require 'parslet' | |
| require 'csv' | |
| # -------------------------------------------------- | |
| # Auxiliary code | |
| class String |
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
| require 'spec_helper' | |
| describe "Mock User object" do | |
| let(:user) do | |
| mock_model User, :find => "pankaj" | |
| end | |
| it "Should validate" do | |
| #@user = User.find(1) | |
| #User.find(:all) |
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
| framework "WebKit" | |
| class Widget | |
| class RPC | |
| class << self | |
| public :include | |
| end | |
| def initialize(widget) | |
| @widget = widget |
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
| # General Apache options | |
| AddHandler fcgid-script .fcgi | |
| AddHandler cgi-script .cgi | |
| #Options +FollowSymLinks +ExecCGI | |
| # If you don't want Rails to look in certain directories, | |
| # use the following rewrite rules so that Apache won't rewrite certain requests | |
| # | |
| # Example: | |
| # RewriteCond %{REQUEST_URI} ^/notrails.* |
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
| [[ -s "/Users/pankajdoharey/.rvm/scripts/rvm" ]] && source "/Users/pankajdoharey/.rvm/scripts/rvm" | |
| #PS1='\033[7h\033[37m\W ∑\033[0m\033[31m™\033[0m»' | |
| echo "$(tput setaf 7)$(tput setab 1)Select an app:$(tput sgr0)" | |
| tput setaf 3 | |
| select i in irb emacs macirb rubinius jruby node.js gnu-smalltalk gnu-lisp cmucl io-lang bash opt vim source | |
| do | |
| tput bold | |
| tput setaf 3 | |
| case $i in | |
| irb) irb --simple-prompt;; |
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
| git clone git://git.savannah.gnu.org/emacs.git | |
| cd emacs | |
| curl -O http://cloud.github.com/downloads/typester/emacs/feature-fullscreen.patch | |
| patch -p1 -i feature-fullscreen.patch | |
| cd .. | |
| curl -O http://ftp.gnu.org/gnu/m4/m4-1.4.13.tar.gz | |
| tar -xzvf m4-1.4.13.tar.gz | |
| cd m4-1.4.13 | |
| ./configure --prefix=/usr/local | |
| make |
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
| require 'rubygems' | |
| require 'fcgi' | |
| ENV['RAILS_ENV'] ||= 'development' | |
| ENV['GEM_HOME'] ||= '/home/user/.gems' | |
| require 'rubygems' | |
| Gem.clear_paths | |
| require File.join(File.dirname(__FILE__), '../config/environment') |
OlderNewer