That is is basically a "fork" of blog article i'm constantly returning to. It seems that the blog is down:
Dave Bass proposed this which I picked up for my implementation (here for an 8-chars token):
require "active_record" | |
namespace :db do | |
db_config = YAML::load(File.open('config/database.yml')) | |
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'}) | |
desc "Create the database" | |
task :create do | |
ActiveRecord::Base.establish_connection(db_config_admin) |
function createStore(reducer) { | |
const store = { | |
state: {}, | |
reducer, | |
dispatch(action) { | |
this.state = this.reducer(action, this.state) | |
} | |
} | |
store.dispatch({}) |
That is is basically a "fork" of blog article i'm constantly returning to. It seems that the blog is down:
Dave Bass proposed this which I picked up for my implementation (here for an 8-chars token):
def fizz_buzz_1(max) | |
arr = [] | |
(1..max).each do |n| | |
if ((n % 3 == 0) && (n % 5 == 0)) | |
arr << "FizzBuzz" | |
elsif (n % 3 == 0) | |
arr << "Fizz" | |
elsif (n % 5 == 0) | |
arr << "Buzz" | |
else |
RSpec.configure do |config| | |
config.before(:all, &:silence_output) | |
config.after(:all, &:enable_output) | |
end | |
# Redirects stderr and stdout to /dev/null. | |
def silence_output | |
@orig_stderr = $stderr | |
@orig_stdout = $stdout |
Just | |
r Module |
arr1 = [[1, 2, [3, 4], 5], 6] | |
arr2 = [[1, 2], 3] | |
arr3 = [1, [2]] | |
arr4 = [[1], 2] | |
arr5 = ["this", ["is", "that", ["Sushi"]], "car"] | |
arr6 = [["this"], ["is", "that", ["Sushi"]], "car"] | |
def flat_arr(arr, new_arr=[]) |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |