Skip to content

Instantly share code, notes, and snippets.

View chreke's full-sized avatar
💭
Just catching up on some reading

Christoffer Ekeroth chreke

💭
Just catching up on some reading
View GitHub Profile
@chreke
chreke / prune.sh
Last active August 29, 2015 14:07
Prune merged branches from your repository
git fetch --prune && git branch --merged master | grep -v 'master$' | xargs -n 1 git branch -d
@chreke
chreke / remotes.sh
Created May 27, 2015 07:02
Show remotes sorted by date
for branch in `git branch -r | grep -v HEAD`
do
echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch
done | sort -r
It is amazing what you can accomplish if you do not care who gets the credit. ~ Harry S. Truman
If we knew what we were doing, it wouldn't be called research, would it? ~ Albert Einstein
Most people would rather die than think; in fact, they do so. ~ Bertrand Russell
Experience is the name everyone gives to their mistakes. ~ Oscar Wilde
All animals are equal — but some animals are more equal than others. ~ Animal Farm by George Orwell
This country has come to feel the same when Congress is in session as when the baby gets hold of a hammer. ~ Will Rogers
I think all foreigners should stop interfering in the internal affairs of Iraq. ~ Paul Wolfowitz
The law will never make men free; it is men who have got to make the law free. ~ Henry David Thoreau
History would be an excellent thing if only it were true. ~ Leo Tolstoy
Without friends no one would choose to live, though he had all other goods. ~ Aristotle
[{
username: 'chreke',
url: 'http://allihoopa.com/chreke'
}, {
username: 'mhallin',
url: 'http://allihoopa.com/mhallin'
}]
@chreke
chreke / .gitconfig
Created October 4, 2016 07:26
Example Git configuration
; Aliases lets you define shortcuts for common git commands,
; so you can type "git st" instead of "git status", for example.
[alias]
st = status
ci = commit --verbose
br = branch
co = checkout
; IMPORTANT! Please specify the same email address here as the one
; you use on GitHub!
[user]
@chreke
chreke / git-commands.sh
Last active October 4, 2016 09:26
Git command cheat sheet
# GENERAL
# =======
# View status
git status
# ADDING CHANGES
# ==============
# The "staging area" is git terminology for what will end up in your next commit
@chreke
chreke / examples.swift
Created January 13, 2017 16:24
Some Swift example code
var maybeString: String?
var maybeAnotherString: String?
maybeString = "hej"
// Optional binding
if let aString = maybeString {
print("This is a string: \(aString)")
}
@chreke
chreke / examples.swift
Created January 13, 2017 16:24
Some Swift example code
var maybeString: String?
var maybeAnotherString: String?
maybeString = "hej"
// Optional binding
if let aString = maybeString {
print("This is a string: \(aString)")
}
@chreke
chreke / examples.swift
Last active January 18, 2017 09:15
Some Swift code examples
// A constant Int
let meaningOfLife = 42
// A variable String
var greeting = "Hello!"
// Type inference on enum members
var directionToHead = CompassPoint.west
directionToHead = .east
@chreke
chreke / filters.js
Last active February 22, 2017 11:49
let filters = [f1, f2, f3]
let users = [u1, u2, u3, u4, u5]
users.filter((user) => {
for f in filters {
if (!f(user)) {
return false
}
}
return true