i've found this useful for debugging ansible modules and syntax without having to use VMs or test in dev environments.
pip install ansible
RewriteEngine On | |
Options +FollowSymLinks | |
RedirectMatch 301 ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$ https://www.shipcloud.io/$1-$2-$3-$4-$5-$6-$7-$8-$9/ [E=underscore_replacer:Yes] | |
RedirectMatch 301 ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$ https://www.shipcloud.io/$1-$2-$3-$4-$5-$6-$7-$8/ [E=underscore_replacer:Yes] | |
RedirectMatch 301 ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$ https://www.shipcloud.io/$1-$2-$3-$4-$5-$6-$7/ [E=underscore_replacer:Yes] | |
RedirectMatch 301 ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$ https://www.shipcloud.io/$1-$2-$3-$4-$5-$6/ [E=underscore_replacer:Yes] | |
RedirectMatch 301 ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$ https://www.shipcloud.io/$1-$2-$3-$4-$5/ [E=underscore_replacer:Yes] | |
RedirectMatch 301 ^([^_]*)_([^_]*)_([^_]*)_(.*)$ https://www.shipcloud.io/$1-$2-$3-$4/ [E=underscore_replacer:Yes] | |
RedirectMatch 301 ^([^_]*)_([^_]*)_(.*)$ https://www.shipcloud.io/$1-$2-$3/ [E=underscore_replacer:Yes] |
upstream myapp_puma { | |
server unix:/tmp/myapp_puma.sock fail_timeout=0; | |
} | |
# for redirecting to https version of the site | |
server { | |
listen 80; | |
rewrite ^(.*) https://$host$1 permanent; | |
} | |
#!/usr/bin/env ruby -w | |
require "benchmark" | |
TIMES = 100_000 | |
ARRAY = (1..1_000).to_a | |
Benchmark.bm(30) do |b| | |
b.report "each" do | |
TIMES.times do |i| | |
ARRAY.each do |element| |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
// Merge a `source` object to a `target` recursively | |
const merge = (target, source) => { | |
// Iterate through `source` properties and if an `Object` set property to merge of `target` and `source` properties | |
for (const key of Object.keys(source)) { | |
if (source[key] instanceof Object) Object.assign(source[key], merge(target[key], source[key])) | |
} | |
// Join `target` and modified `source` | |
Object.assign(target || {}, source) | |
return target |
Jest cheat sheet
https://github.com/sapegin/jest-cheat-sheet
Access component method
wrapper.instance().componentMethod
iOS9 returns double the value for window.innerWidth
& window.innerHeight
The versions that are concerned are: 9.0.0
, 9.0.1
, 9.0.2
A few people got mad on twitter:
window.innerWidth in iOS 9 Safari returns double the number it did in iOS 8? Is this real life? tell me no — @rachsmithtweets
iOS9 Safari has the most insane bug where window.innerWidth / innerHeight is *sometimes* twice as large as it should be. ughhhh. !? — @mattdesl
iOS9 innerWidth/innerHeight is having a lot of fun these days — @ayamflow