Skip to content

Instantly share code, notes, and snippets.

View peralmq's full-sized avatar

Pelle Frank peralmq

View GitHub Profile
@peralmq
peralmq / BoardGameGeek.kt
Last active January 10, 2016 17:49
BoardGameGeek API client in Kotlin
import android.util.Xml
import org.xmlpull.v1.XmlPullParser
import java.io.InputStream
import java.net.URL
import java.util.*
data class BoardGame(val id: Int, val name: String?, val yearpublished: Int?)
data class BoardGames(val games: List<BoardGame>)
public class BoardGameGeek {
#!/bin/sh
# Create a local database and populate with data from Heroku pg:backups
if [ $# != 2 ]; then
echo 1>&2 "usage: $0 BACKUP_ID APP_NAME"
exit 2
fi
BACKUP_ID=$1
APP_NAME=$2
BACKUP_FILE=/tmp/$BACKUP_ID.dump
@peralmq
peralmq / deleteAllRabbitMQConnections.sh
Created April 8, 2015 13:00
Oneliner for deleting all RabbitMQ connections.
# Probably only works for ZSH. Expects jq (http://stedolan.github.io/jq/) and node (https://nodejs.org/) to be installed
# Replace <user>, <password>, and <host> to suit your needs.
URL="https://<user>:<password>@<host>.cloudamqp.com"; for name in "${(@f)$(http $URL/api/connections | jq '.[]|.name')}"; do encoded=`node -e "console.log(encodeURIComponent($name))"`; http DELETE $URL/api/connections/$encoded; done
@peralmq
peralmq / keybase.md
Created August 14, 2014 15:08
keybase.md

Keybase proof

I hereby claim:

  • I am peralmq on github.
  • I am peralmq (https://keybase.io/peralmq) on keybase.
  • I have a public key whose fingerprint is 7AA8 89CE 9F68 CA40 4128 4391 BCC4 3052 D4B3 32E0

To claim this, I am signing this object:

@peralmq
peralmq / S-Copy0.ipynb
Last active August 29, 2015 13:56
Mall S
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.