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
gem install interactive_editor |
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
#show git branch | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
function proml { | |
local BLUE="\[\033[0;34m\]" | |
local RED="\[\033[0;31m\]" | |
local WHITE="\[\033[1;37m\]" | |
local GREEN="\[\033[0;10m\]" |
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 MySqlDatabaseFactory | |
class << self | |
def create_connection | |
MySqlConnection.new | |
end | |
def create_generator | |
MySqlGenerator.new | |
end | |
end |
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 'temperature_converter' | |
#================= Program ==================# | |
print %Q{ | |
Welcome to super simple temperature converter | |
============================================= | |
1. Celsius to Fahrenheit | |
2. Fahrenheit to Celsius | |
Please select our converter method[1]:} |
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 Person < Struct.new(:name, :programs_ruby) | |
def cool_feeling | |
puts "#{name} is definietly cool!" | |
end | |
end | |
class People < Struct.new(:list) | |
def who | |
SelectQuery.new(self) |
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
get "/proof/:id" do | |
@color = "red" | |
@listing = Listing.first(:alias_id => params[:id], :portal_uuid => 'A4E7890F-A188-4663-89EB-176D94DF6774') | |
nokogiri :proof | |
end | |
get "/directory" do | |
@categories = Category.all(:portal_uuid => "A4E7890F-A188-4663-89EB-176D94DF6774", | |
:subcategory_count => 0, |
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
1. Why use VIM? | |
VIM rocks! | |
VI or VIM? | |
I hate the mouse! | |
I am a text person | |
I love touch-typing (huh - what is touch typing% again..) | |
You have production server with only SSH access! | |
2. Vim -- you already knew | |
Command mode & Insert mode |
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 A | |
@@a = 1 | |
@a = 2 | |
a = 3 | |
singleton_class.send(:define_method, :bindings) { binding } | |
end | |
p eval('[@@a, @a, a]', A.bindings) |
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
ID, account, tel, last_access, name | |
'A-23-112', 'ashbb', 2234, 'Aug 13th', 'Satoshi' | |
'B-34-122', 'tiger', 5543, 'May 1st', 'Satish' | |
'A-15-982', 'pen', 7812, 'Sep 24th', 'Michael' |
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
//Swap value between two variables | |
int a = 5, b = 10; | |
int temp = a; | |
a = b; | |
b = temp; | |
//Output message 3 times | |
for(int i = 0; i <= 3; i++) | |
Console.WriteLine("Hello"); |
OlderNewer