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
package include1 | |
import ( | |
"fmt" | |
"runtime" | |
) | |
func hello() string { | |
return fmt.Sprintf("Hello from %s", runtime.GOOS) | |
} |
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
type StringFlag []string | |
func (s *StringFlag) String() string { | |
return strings.Join(*s, ",") | |
} | |
func (s *StringFlag) Set(value string) error { | |
*s = append(*s, value) | |
return nil | |
} |
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
import "strings" | |
type StringFlag []string | |
func (s *StringFlag) String() string { | |
return strings.Join(*s, ",") | |
} | |
func (s *StringFlag) Set(value string) error { |
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
FROM ubuntu | |
# Install basic packages | |
RUN apt-get update | |
RUN apt-get install -y build-essential wget curl git | |
RUN apt-get install -y zlib1g-dev libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt-dev | |
RUN apt-get install -y sqlite3 libsqlite3-dev | |
RUN apt-get clean | |
# Install rbenv and ruby-build |
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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"os" | |
"testing" | |
) | |
func Test_chdir(t *testing.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
hash = {a: 23, b: 24, c: 25} | |
puts hash.values.inject(&:+) == (23+24+25) # >> true |
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 ChangeTableName < ActiveRecord::Migration | |
def self.up | |
rename_table :a_tables, :b_tables | |
end | |
def self.down | |
rename_table :b_tables, :a_tables | |
end | |
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 Addindex < ActiveRecord::Migration | |
def self.up | |
add_index :a_table, :name | |
end | |
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 CreateTable < ActiveRecord::Migration | |
def self.up | |
create_table :a_tables do |t| | |
t.column :name1, :integer, :null => false | |
t.column :name2, :text, :null => false | |
t.timestamps | |
end | |
end | |
def self.down |
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
<div class="video-container"> | |
<iframe src="http://player.vimeo.com/video/78074896" width="500" height="281" frameborder="0"></iframe> | |
</div> |