Skip to content

Instantly share code, notes, and snippets.

View starkcoffee's full-sized avatar

Duana Saskia starkcoffee

View GitHub Profile
@aaronlevin
aaronlevin / cps.scala
Last active October 23, 2017 20:51
Scala version of the blog post Resources, Laziness, and Continuation-Passing Style
object cps {
/**
*
* The code below translates this blog post
* http://blog.infinitenegativeutility.com/2016/8/resources--laziness--and-continuation-passing-style)
* into scala, and uses laziness where appropriate to highlight the issue.
*
* I also include a type for IO. This is mainly illustrative, but also ensures
* we "sequence" actions appropriately. Haskell's IO monad works in tandem with the
anonymous
anonymous / Sign-in,-then-Tabs:-1.0.0-beta.1.markdown
Created April 19, 2014 14:25
A Pen by Ionic.

Sign-in, then Tabs: 1.0.0-beta.1

Demo showing how each tab has its own history stack. Navigating between each tab remembers the correct back and forward views that were visited.

A Pen by Ionic on CodePen.

License.

@hannestyden
hannestyden / ppjson.sh
Created April 18, 2012 14:07
New version of the old classic
ppjson () {
ruby -e "require 'json'; puts JSON.pretty_generate(JSON.parse(STDIN.read))"
}
@schacon
schacon / gist:942899
Created April 26, 2011 19:19
delete all remote branches that have already been merged into master
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete
@karnowski
karnowski / zombie.synchronousChain.coffee
Created April 15, 2011 18:18
Zombie.js + Vows: Capybara-like synchronous chain example
# ... require zombie, vows, etc. ...
events = require("events")
zombie.synchronousChain = (browser, steps)->
promise = new(events.EventEmitter)
zombie._linkInTheChain(promise, browser, steps)
promise
zombie._linkInTheChain = (promise, browser, steps)->
@JosephPecoraro
JosephPecoraro / shell-execution.rb
Last active September 10, 2023 10:12
Shell Execution in Ruby
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Synchronous (blocking)
# Returns the output of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111