Skip to content

Instantly share code, notes, and snippets.

Pelle Almquist peralmq

Block or report user

Report or block peralmq

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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 {
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 / 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 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:

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.
You can’t perform that action at this time.