This file contains 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
#!/bin/bash | |
nginx -V | tr [[:space:]] "\n" | grep -E '^--with-.+_module$' | awk -F- '{ print $NF }' |
This file contains 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 MinMax | |
def initialize | |
@minmax = [] | |
end | |
def <<(element) | |
@minmax = (@minmax + [element]).minmax | |
element | |
end | |
This file contains 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
rbenv versions --bar | grep -qx "$(cat .ruby-version)" || rbenv install "$(cat .ruby-version)" |
This file contains 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 String | |
def to_proc | |
proc { |target,*args| target.send(self, *args) } | |
end | |
end | |
[1,2,3,4].reduce(&'+') |
This file contains 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 NotSetError < StandardError; end | |
class NotSet < BasicObject | |
def initialize(target, location = ::Kernel.caller.first) | |
@location = location | |
@target = target | |
end | |
def self.[](target, location = ::Kernel.caller.first) | |
new(target, location) |
This file contains 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
#!/bin/bash | |
local_cache_dir=$PWD/Pods | |
global_cache_dir=$HOME/Library/Caches/CocoaPods | |
if [ -d $local_cache_dir ]; then | |
rm -rf $local_cache_dir | |
rm -rf $global_cache_dir | |
else | |
>&2 "No local Pods directory, are you in the right directory?" |
This file contains 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
GIT=git | |
GIT_SUBMODULES=$(shell sed -nE 's/path = +(.+)/\1\/.git/ p' .gitmodules | paste -s -) | |
.PHONY: all | |
all: $(GIT_SUBMODULES) | |
$(GIT_SUBMODULES): %/.git: .gitmodules | |
$(GIT) submodule init | |
$(GIT) submodule update $* | |
@touch $@ |
This file contains 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
function directly(value) { | |
return Promise.resolve(value); | |
} | |
function later(value) { | |
return new Promise(resolve => { | |
setTimeout(() => resolve(value), 500); | |
}); | |
} |
This file contains 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
#!/bin/bash | |
print_error() { | |
1>&2 echo "$@" | |
} | |
fail() { | |
if [[ $# -gt 0 ]]; then | |
print_error "$@" | |
fi |
This file contains 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
--- | |
parser: babel-eslint | |
parserOptions: | |
ecmaVersion: 6 | |
sourceType: module | |
ecmaFeatures: | |
impliedStrict: true | |
environment: | |
node: true | |
rules: |