Skip to content

Instantly share code, notes, and snippets.


Zac Sweers ZacSweers

View GitHub Profile
tecoholic /
Created May 23, 2011
This sample code (written in Python) demonstrates integrating Facebook Chat using the X-FACEBOOK-PLATFORM authentication mechanism.
#!/usr/bin/env python
# This is a demonstration script for Facebook Chat
# using the X-FACEBOOK-PLATFORM SASL mechanism.
# It requires pyfacebook and pyxmpp to be installed.
# This client only works for desktop applications (configured in the
# developer app), and uses the old-style auth.getSession mechanism to get a
# Facebook session. For newer-style or web apps, only the
# `get_facebook_client` function should have to change.
chrisroos /
Created Sep 9, 2011
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
# or, instead of backing up trustdb...
kecebongsoft / 10fastfinger_bot.js
Created Dec 22, 2011
BOT for 10fastfingers, automatic typing with adjustable speed
View 10fastfinger_bot.js
* BOT for 10fastfingers, automatic typing with adjustable speed
* ================================================================
* bored in my apartment and decided to hack this game:
* just start the game, when you're ready to type, DON'T TYPE ANYTHING, open up
* your Developer Tools in Chrome (CTRL+SHIFT+J) and click Console tab, and
* then paste the whole code below, then press enter, and enjoy the show.


A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

nikcub /
Created Oct 4, 2012
Facebook PHP Source Code from August 2007
Antarix /
Created Nov 29, 2012
UrlImage Parser for android TextView to load Html Image tag
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import android.content.Context;
zach-klippenstein /
Last active Mar 3, 2021
The keystore password on Java keystore files is utterly pointless. You can reset it without knowing it, as shown by this code. Note that private keys are still secure, as far as I know. The JKS implementation is copyright Casey Marshall (, and the original source is available at I've in…
import java.util.*;
public class ChangePassword
private final static JKS j = new JKS();
public static void main(String[] args) throws Exception
agscala /
Created Jan 30, 2013
python [vine_url] [output_file] Scrapes vine url, downloads video, and converts the file to a gif with mplayer
from pyquery import PyQuery as pq
import sys
import subprocess
import os
from urllib2 import urlopen, URLError, HTTPError
def convert(input_file, output_gif):
print "CONVERT", input_file, " => ", output_gif["mplayer", input_file, "-ao", "null", "-ss", "0:0:0", "-endpos", "6", "-vo", "gif89a:fps=8:output=%s" % output_gif, "-vf", "scale=240:180"])
imminent /
Last active Oct 23, 2017
Dagger `ObjectGraph` utility to hide the mess of injecting the different Android classes. Note this is inspired by
import javax.annotation.Nonnull;
import android.content.Context;
* <p>Retrieves the {@link dagger.ObjectGraph} and injects dependencies.</p>
* @author Dandré Allison
dodyg / gist:5823184
Last active Feb 17, 2021
Kotlin Programming Language Cheat Sheet Part 1
View gist:5823184


Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at

All the codes here can be copied and run on Kotlin online editor.

Let's get started.