Skip to content

Instantly share code, notes, and snippets.

View bripkens's full-sized avatar
🙃

Ben Blackmore bripkens

🙃
View GitHub Profile
@bripkens
bripkens / unfuck.bash
Created February 4, 2014 12:58
This gist is meant to be a joke. Do not use it. Bad things may happen! :-D
unfuck() {
remote=$(git remote -v | head -n 1 | awk '{print($2)}')
d=$(pwd)
cd ..
rm -rf $d
git clone $remote
}
@bripkens
bripkens / gist:7b63afad7a81fd6184e6
Created May 4, 2014 18:41
maven release commands and process
mvn release:clean
mvn release:prepare
mvn release:perform
# go to https://oss.sonatype.org/ -> Staging repositories -> close -> check verification status -> release
@bripkens
bripkens / affirmation
Created May 22, 2014 05:43
MuleSoft Contributor Agreement Acceptance by Ben Ripkens
I, Ben Ripkens, have read and do accept the MuleSoft Contributor Agreement
at http://www.mulesoft.org/legal/contributor-agreement.html
Accepted on Thu May 22 2014 07:43:30 GMT+0200 (CEST)
$ curl -X POST --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0d2l0dGVyIjoiQmVuUmlwa2VucyIsImVtYWlsIjoiYmVuLnJpcGtlbnNAY29kZWNlbnRyaWMuZGUiLCJjb21wYW55IjoiY29kZWNlbnRyaWMgQUcifQ.7NnQqoNmh3UKl81cgyULwVrIpRiY7K-ABeeZBGpHbxI" https://auth0.com/challenges/devoxx -v
* Hostname was NOT found in DNS cache
* Trying 54.183.201.90...
* Connected to auth0.com (54.183.201.90) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* Server certificate: *.auth0.com
* Server certificate: EssentialSSL CA
* Server certificate: COMODO Certification Authority
> POST /challenges/devoxx HTTP/1.1
> User-Agent: curl/7.37.1
@bripkens
bripkens / install-xbmc-on-fire-tv.bash
Last active August 29, 2015 14:09
Install XBMC on Kindle Fire TV
#!/bin/bash
set -eo pipefail
FIRE_TV_IP="192.168.0.105"
XBMX_APK="http://mirrors.xbmc.org/releases/android/arm/xbmc-13.2-Gotham-armeabi-v7a.apk"
export PATH="$PATH:/Applications/Android\ Studio.app/sdk/platform-tools:/Applications/Android\ Studio.app/sdk/tools"
adb kill-server
@bripkens
bripkens / route-definition.js
Last active August 29, 2015 14:10
A quick test how to use the Angular UI router without controllers. Would need to remove resolvers as well, no?
angular.module('scheduler.conferences', ['ui.router', 'expose-to-scope'])
.config(function($stateProvider) {
$stateProvider
.state('conferences', {
url: '/conferences',
directive: 'conferenceList',
resolve: {
conferences: function(ConferenceService) {
@bripkens
bripkens / workshop-vorbereitungen
Created January 15, 2015 07:36
Ionic Workshop Vorbereitungen
1.) Aktuelle Version von Chrome installieren
Installer kann heruntergeladen werden unter:
https://www.google.com/intl/en/chrome/browser/
2.) Chrome Erweiterung “Batarang” aus dem Chrome Web Store installieren
Die Erweiterung kann über den Chrome Web Store installiert werden:
https://chrome.google.com/webstore/detail/angularjs-batarang/ighdmehidhipcmcojjgiloacoafjmpfk?hl=en
3.) Aktuelle Version von Node.js und NPM installieren
Installer kann heruntergeladen werden unter:
@bripkens
bripkens / homeAutomationBackend.conf
Last active August 29, 2015 14:14
Home automation raspberry PI setup
#!upstart
# put in /etc/init/homeAutomationBackend.conf
description "Home Automation Backend Server"
author "Ben Ripkens"
start on startup
stop on shutdown
respawn
script
@bripkens
bripkens / config.clj
Created February 8, 2015 16:52
How can one mock this?
(ns config)
; to be populated on application start before `service` is required.
; how can this def be mocked?
(def settings {})
@bripkens
bripkens / article.md
Last active August 29, 2015 14:16
Cancelable asynchronous operations with Promises

Lets take a look at existing cancelable AngularJS APIs:

$timeout

$timeout can be canceled via $timeout.cancel(promise). To make this possible, a $$timeoutId (source) is registered on the promise. This value is read by the $timeout.cancel(promise) function to actually call clearTimeout(...).

Unfortunately, this is not a good example for cancelable asynchronous operations with Promises.

$timeout returns a promise on which the then(onFulfilled, onRejected) function can be called. This function returns a new promise which does not have a $$timeoutId property and therefore cannot be used to call $timeout.cancel(promise).