Skip to content

Instantly share code, notes, and snippets.

Avatar

Pelle Almquist peralmq

View GitHub Profile
View S-Copy0.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View 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 / deleteAllRabbitMQConnections.sh
Created Apr 8, 2015
Oneliner for deleting all RabbitMQ connections.
View deleteAllRabbitMQConnections.sh
# 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
View herokuPGBackupToLocalDatabase.sh
#!/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 / BoardGameGeek.kt
Last active Jan 10, 2016
BoardGameGeek API client in Kotlin
View BoardGameGeek.kt
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 {
You can’t perform that action at this time.