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
| window.print = function(s) { | |
| document.write(s); | |
| }; | |
| window.puts = function(s) { | |
| document.write(s); | |
| document.write("<br>"); | |
| }; | |
| Array.prototype.equals = function(other) { |
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 'active_record' | |
| ActiveRecord::Base.establish_connection( | |
| "adapter" => "sqlite3", | |
| "database" => "./data.sqlite") | |
| class TestCreation < ActiveRecord::Migration | |
| def up | |
| create_table :entries do |t| | |
| t.string :title |
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
| # -*- coding: utf-8 -*- | |
| require 'active_record' | |
| ActiveRecord::Base.establish_connection( | |
| "adapter" => "sqlite3", | |
| "database" => "./sample.sqlite") | |
| class CreateWebSite < ActiveRecord::Migration | |
| def up |
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
| # /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin | |
| export LANG=ja_JP.UTF-8 | |
| HISTFILE=$HOME/.zsh-history | |
| HISTSIZE=100000 | |
| SAVEHIST=100000 | |
| # エディタを最小構成のEmacsに設定する | |
| export EDITOR="emacs -nw -q" |
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
| #パスの設定 | |
| PATH=$HOME/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/rcodetools-0.8.5.0:$PATH | |
| export MANPATH=/usr/local/share/man:/usr/local/man:/usr/share/man | |
| export PATH="$HOME/.rbenv/bin:$PATH" | |
| export PATH=$PATH:/usr/local/share/npm/bin | |
| export PATH="/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:$PATH" | |
| eval "$(rbenv init -)" |
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
| MAX = 100 | |
| target = Array(2..MAX) | |
| prime_numbers = [] | |
| LIMIT = Math.sqrt(MAX) | |
| until target.first > LIMIT | |
| sieve = target.shift | |
| prime_numbers << sieve | |
| target.delete_if {|n| (n % sieve).zero? } | |
| 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
| <!DOCTYPE html> | |
| <html lang="ja"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>たいとる</title> | |
| </head> | |
| <body> | |
| はろー | |
| </body> | |
| </html> |
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
| <!DOCTYPE html> | |
| <html lang="ja"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Title</title> | |
| </head> | |
| <body> | |
| <div id="yo-button"></div> |
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
| def self.create(*args, &block) | |
| # do something | |
| super(*args, &block) | |
| 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
| class RandomString | |
| CANDIDATES = ['0'..'9', 'a'..'z', 'A'..'Z'].map(&:to_a).flatten | |
| def self.generate(length: 8) | |
| (1..length).map { CANDIDATES.sample }.join | |
| end | |
| end |
OlderNewer