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
class Foo | |
class << self | |
attr_reader :ivar | |
end | |
@ivar = 'Hello!' | |
end | |
class Bar < Foo | |
@ivar = 'World' | |
end |
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
<?php | |
class A { | |
public static $name = null; | |
} | |
A::$name = "a"; | |
class B extends A { | |
} | |
B::$name = "b"; |
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
ag.vim | |
bufexplorer | |
camelcasemotion | |
ctrlp.vim | |
emmet-vim | |
L9 | |
limelight.vim | |
nerdcommenter | |
nerdtree | |
syntastic |
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
require "minitest/autorun" | |
require "minitest/spec" | |
require "spreadsheet" | |
describe 'spreadsheet' do | |
before do | |
@doc ||= Spreadsheet.open "spreadsheet.xls" | |
puts "document object id: #{@doc.object_id}" | |
end |
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
module TimeExtensions | |
refine Fixnum do | |
def min2sec; self * 60; end | |
end | |
end | |
class Minutes | |
using TimeExtensions | |
def self.to_sec(min) |
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
# Use it like `export PS1="\h:\w[\$(ahead_behind)]$"` | |
function ahead_behind { | |
curr_branch=$(git rev-parse --abbrev-ref HEAD); | |
curr_remote=$(git config branch.$curr_branch.remote); | |
curr_merge_branch=$(git config branch.$curr_branch.merge | cut -d / -f 3); | |
git rev-list --left-right --count $curr_branch...$curr_remote/$curr_merge_branch | tr -s '\t' '|'; | |
} |
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
class Printer | |
@messages = [] | |
def self.print | |
puts yield | |
end | |
def self.lazy_print(val=nil,&block) | |
@messages << val || block | |
end |
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
by Steven J. Vaughan-Nichols, zdnet.com | |
June 23rd 2013 | |
Summary: In recent weeks Microsoft has been doing some odd things with mobile operating systems, Windows RT, and Windows Phone 8. I think Microsoft is moving towards dropping its mobile OSs in favor of supporting Microsoft applications on other platforms and eventually replacing them with Windows 8.1 on their own devices. | |
This is not your dad's Microsoft. Microsoft has been refocusing on Web services and devices instead of Windows and software products. One of those changes seems to be that if Microsoft's mobile operating systems can't cut the mustard, Microsoft isn't afraid to cut them off at the knees. | |
What am I talking about? Let's look at some of Microsoft's mobile news in the last few weeks. | |
First, some background. Goodness knows Windows 8 has been a market failure, but it's a rip-roaring success compared to Windows RT and Windows Phone 8 (WP8). |
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
class Pessoa | |
attr_accessor :nome | |
def initialize(nome) | |
self.nome = nome | |
end | |
def ==(outra) | |
outra == self.nome | |
end |
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
class Pessoa | |
include Comparable | |
attr_accessor :nome | |
def initialize(nome) | |
self.nome = nome | |
end | |
def <=>(outra) | |
return -1 if outra.size<self.nome.size |