RUBY_VERSION
has never changed within major Mac OS X releases.
Mac OS X version* | Mac OS X release date |
---|
RUBY_VERSION
has never changed within major Mac OS X releases.
Mac OS X version* | Mac OS X release date |
---|
const arr = [["foo", "bar"], ["hello", "world"]]; | |
// Create object from array of tuples | |
const obj = {}; arr.forEach(el => obj[el[0]] = el[1]); | |
const map = new Map(arr); | |
// Get object size | |
const objSize = Object.keys(obj).length; | |
const mapSize = map.size; |
alias latest='function _latest(){ curl -s "https://rubygems.org/api/v1/versions/$1/latest.json" | cut -d"\"" -f 4 };_latest' |
# ESV - Excel generation with the ease of CSV generation. | |
# | |
# By Henrik Nyh 2015-07-01 under the MIT license. | |
# Using a lot of code from LivingSocial's Excelinator, also under the MIT license: https://github.com/livingsocial/excelinator/blob/master/lib/excelinator/xls.rb | |
require "spreadsheet" | |
class ESV | |
def self.generate | |
instance = new |
#cloud-config | |
coreos: | |
etcd: | |
# generate a new token for each unique cluster from https://discovery.etcd.io/new | |
discovery: https://discovery.etcd.io/<token> | |
# multi-region deployments, multi-cloud deployments, and droplets without | |
# private networking need to use $public_ipv4 | |
addr: $private_ipv4:4001 | |
peer-addr: $private_ipv4:7001 |
# config/routes.rb | |
resources :documents do | |
scope module: 'documents' do | |
resources :versions do | |
post :restore, on: :member | |
end | |
resource :lock | |
end | |
end |
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure
flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.
Use production SSL certificates locally. This is annoying
You can break these rules if you can talk your pair into agreeing with you.
# Just replace the URL (don't forget "/raw") | |
curl --silent https://www.stypi.com/raw/avand/interviews/reverse_polish_notation.rb | ruby |
J.B. Rainsberger - Integration Tests are a Scam
J.B. Rainsberger - When Is It Safe to Introduce Test Doubles?
Gary Bernhardt - Boundaries
Gary Bernhardt - Functional Core, Imperative Shell
Tom Stuart - Thinking functionally in Ruby