View gist:0982b620a022346a34d24a961c5bb517
// modified from http://brettterpstra.com/2017/06/14/full-hyper-key-functionality-restored-in-sierra/
// this makes caps lock turn into "left control" if pressed with another key
// and "escape" if pressed by itself. Requires karabiner elements 0.91.3 or higher to have
// the "to_if_alone" section. Place after "simple_modifications" in the ~/.config/karabiner/karabiner.json file
"complex_modifications": {
"rules": [
{
"manipulators": [
{
"description": "Change caps_lock to command+control+option+shift. Escape if no other key used.",
View gist:c4ed5ec8e047f1adb13c1dd333bbb2e2
# RUN AT YOUR OWN RISK, UNDERSTAND THE COMMANDS AND DO NOT RUN BLINDLY
This will find all the duplicate photos in a `raw_photos` directory.
create md5sum of all files (after `brew install coreutils`):
find raw_photos -type f -exec gmd5sum "{}" + > files.md5
then sort that and you can find the files where the md5sum (the first field) is repeated for spot-checking and comparison
View .gitconfig
[alias]
# clickable http link to github repo
repourl=!"echo https://$(git remote get-url --push origin | sed 's/git\\@\\(.*\\)\\.git/\\1/' | sed 's/:/\\//')"
# push out a feature branch with a clickable link for creating a pull request against your upstream origin branch
pusho = !git push origin $(git branchname) && echo "create a pull request at: $(git repourl)/compare/$(git rev-parse --abbrev-ref --symbolic-full-name @{upstream} | awk -F'/' '{print $NF}')...$(git branchname)?expand=1"
View ratpackParallelReactiveStreams.groovy
#! /usr/bin/env groovy
import ratpack.exec.Blocking
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.func.Block
import ratpack.groovy.test.embed.GroovyEmbeddedApp
import ratpack.handling.Context
import ratpack.http.client.HttpClient
import ratpack.rx.RxRatpack
import ratpack.service.Service
View ratpackSerialReactiveStreams.groovy
#! /usr/bin/env groovy
import ratpack.exec.Blocking
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.func.Block
import ratpack.groovy.test.embed.GroovyEmbeddedApp
import ratpack.handling.Context
import ratpack.http.client.HttpClient
import ratpack.rx.RxRatpack
import ratpack.service.Service
View ratpackLoggingExecInterceptorForkCompute.groovy
#! /usr/bin/env groovy
import ratpack.exec.Downstream
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.exec.Promise
import ratpack.func.Block
import ratpack.handling.Context
import static ratpack.groovy.Groovy.ratpack
View ratpackLoggingExecInterceptor.groovy
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.func.Block
import ratpack.handling.Context
import static ratpack.groovy.Groovy.ratpack
@GrabResolver(name = 'jcenter', root = 'http://jcenter.bintray.com/')
@GrabExclude('org.codehaus.groovy:groovy-all')
@Grab('io.ratpack:ratpack-groovy:1.3.0')
View ratpackLoggingExecInterceptorWithBlocking.groovy
import ratpack.exec.Blocking
import ratpack.exec.ExecInterceptor
import ratpack.exec.Execution
import ratpack.func.Block
import ratpack.handling.Context
import static ratpack.groovy.Groovy.ratpack
@GrabResolver(name = 'jcenter', root = 'http://jcenter.bintray.com/')
@GrabExclude('org.codehaus.groovy:groovy-all')
View ratpackSimpleAsyncPromise.groovy
import ratpack.exec.Promise
import ratpack.handling.Context
import ratpack.groovy.test.embed.GroovyEmbeddedApp
@GrabResolver(name = 'jcenter', root = 'http://jcenter.bintray.com/')
@GrabExclude('org.codehaus.groovy:groovy-all')
@Grab('org.slf4j:slf4j-simple:1.7.12')
@Grab('io.ratpack:ratpack-groovy:1.3.3')
@Grab('io.ratpack:ratpack-rx:1.3.3')
View ratpackSimpleBlocking.groovy
import ratpack.exec.Blocking
import ratpack.handling.Context
import ratpack.groovy.test.embed.GroovyEmbeddedApp
@GrabResolver(name = 'jcenter', root = 'http://jcenter.bintray.com/')
@GrabExclude('org.codehaus.groovy:groovy-all')
@Grab('org.slf4j:slf4j-simple:1.7.12')
@Grab('io.ratpack:ratpack-groovy:1.3.3')
@Grab('io.ratpack:ratpack-rx:1.3.3')