Skip to content

Instantly share code, notes, and snippets.


Benjamin Van Ryseghem BenjaminVanRyseghem

View GitHub Profile
BenjaminVanRyseghem /
Last active May 25, 2016
Script to delete branches that have been merged (and are "gone").
git fetch -p > /dev/null 2>&1
branches=`git branch -vv | grep ': gone]' | awk '{print $1}'`
if [[ -z "$branches" ]]
echo "No branch to prune"
exit 0
BenjaminVanRyseghem / reviewable-bindings.json
Last active May 23, 2016
My custom bindings for
View reviewable-bindings.json
"Show next/latest diffs",
"Next unreviewed file",
#!/usr/bin/env python
import parsedatetime
import sys
from time import mktime
from datetime import datetime
AS_DATE_FORMAT = "%d/%m/%y"
string = sys.argv[1]
BenjaminVanRyseghem / things.scpt
Last active Aug 29, 2015
Mail -> Things sync
View things.scpt
on theSplit(theString, theDelimiter)
-- save delimiters to restore old settings
set oldDelimiters to AppleScript's text item delimiters
-- set delimiters to delimiter to be used
set AppleScript's text item delimiters to theDelimiter
-- create the array
set theArray to every text item of theString
-- restore the old setting
set AppleScript's text item delimiters to oldDelimiters
-- return the result
BenjaminVanRyseghem /
Last active Dec 18, 2016
Drag and Drop Spec Tutorial
collection1 := #(1 2 3 4 5) asOrderedCollection.
collection2 := #(a b c d e) asOrderedCollection.
list1 := ListModel new
items: collection1;
list2 := ListModel new
items: collection2;
BenjaminVanRyseghem /
Created Mar 2, 2014
How to make a list render some custom models -- see
items := (1 to: 5) collect: [ :index || model |
model := DynamicComposableModel new
instantiateModels: #(
nameLabel LabelModel
address LabelModel
button ButtonModel ).
model nameLabel label: 'Name'.
model address label: 'Address'.
model button
label: nil;
BenjaminVanRyseghem /
Created Feb 28, 2014
Pharo preference to set git repo to Spec project
name: 'Set git repo'
code: 'MCWorkingCopy allManagers
select: [ :e | e package name beginsWith: ''Spec'' ]
thenDo: [ :e || repository |
repository := MCFileTreeRepository new directory: ''/Users/benjamin/Documents/Benjamin/Spec/spec'' asFileReference.
e repositoryGroup addRepository: repository ]'
runOnce: true.