- Install Ruby ~> 2.6
gem install rspec- Open an IRB session with
irb -r ./linked_list.rb
list = LinkedList.new| class MySingletonClass | |
| include Singleton | |
| attr_reader :client | |
| def initialize | |
| @client = Service::We::Only::Ever::Need::One::Connection::To.new(SERVICE_URL) | |
| end | |
| end |
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| var a1 = [3]int{1, 2, 3} | |
| var s1 = a1[0:3] | |
| func main() { |
| # A prime is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers | |
| def prime?(int) | |
| # A prime is a natural number greater than 1... | |
| return false if int < 2 | |
| # Is _int_ evenly divisible by any number 2 -> int-1? | |
| (2..(int - 1)).each do |divisor| | |
| return false if int % divisor == 0 | |
| end | |
| return true |
Tempfiles since they would be GC'd too quickly)1>>stdout_tempfile_path 2>>stderr_tempfile_path{original commands with io redirection &&'d together}; bundle exec rake cleanup_taskOther than the default Panini pieces, you will also need to make sure that lodash is included as a devDependencies in your package.json
Tag a section of text as translatable. The section will be replaced with a set of if/elseif/else Merge Tags for each translation provided, otherwise only the wrapped content is displayed.
| # Put this in Rakefile (doesn't matter where) | |
| require 'benchmark' | |
| class Rake::Task | |
| def execute_with_benchmark(*args) | |
| bm = Benchmark.measure { execute_without_benchmark(*args) } | |
| puts " #{name} --> #{bm}" | |
| end | |
| alias_method :execute_without_benchmark, :execute |
| source 'https://rubygems.org' | |
| ruby '2.1.4' | |
| gem 'rails', '~> 3.2.0' | |
| gem 'mysql2' | |
| group :development, :test do | |
| gem 'byebug' |
| # RUBY / RUBY ON RAILS COMMANDS | |
| alias bexec='bundle exec' | |
| alias rails_mv="bexec rails -v | sed 's/Rails \([0-9]\).*/\1/g'" | |
| # Alias the rake command to Spring binstubs or fallback to "bundle exec" | |
| # http://goo.gl/HkhHAf, http://goo.gl/STtIvF | |
| function brake { | |
| if [ -f bin/rake ] | |
| then | |
| bin/rake "$@" | |
| else |
| require 'capistrano/rvm' |