Skip to content

Instantly share code, notes, and snippets.

View markcerqueira's full-sized avatar
📌
Join me! Pinterest is hiring!

Mark Cerqueira markcerqueira

📌
Join me! Pinterest is hiring!
View GitHub Profile
### Keybase proof
I hereby claim:
* I am markcerqueira on github.
* I am markcerqueira (https://keybase.io/markcerqueira) on keybase.
* I have a public key whose fingerprint is 33B3 AC7E F7E6 6D6B 8CC4 06AC 6475 B202 D01D 64BD
To claim this, I am signing this object:
@markcerqueira
markcerqueira / imggen.py
Last active August 29, 2015 14:15
A Python script to generate HUGE images
#!/usr/bin/python
# good luck setting up Pillow on your computer!
from PIL import Image
from PIL import ImageDraw
from random import randint
# width and height in pixels
SIZE = 200
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
doWork("string_param");
}
// Note the parameter variable name (i.e. string)
@markcerqueira
markcerqueira / FFRKItemIdParser.py
Last active August 29, 2015 14:19
Parses out item names and ids from the response to the party/list API
This file was migrated to: https://github.com/markcerqueira/ff-record-keeper
@markcerqueira
markcerqueira / gist:d4ec280f5c448d7ca45e
Last active August 29, 2015 14:19
Final Fantasy Record Keeper - API Analysis - dff/party/list
This file was migrated to: https://github.com/markcerqueira/ff-record-keeper
@markcerqueira
markcerqueira / gist:59cf24051f0ca404f66c
Last active August 29, 2015 14:19
Final Fantasy Record Keeper - API Analysis - battle/get_battle_init_data
This file was migrated to: https://github.com/markcerqueira/ff-record-keeper
@markcerqueira
markcerqueira / FFRKBattleDropParser.py
Last active August 29, 2015 14:19
Parses out item drops from battle/get_battle_init_data API
This file was migrated to: https://github.com/markcerqueira/ff-record-keeper
@markcerqueira
markcerqueira / gist:400f3b6ac516690f72cd
Last active September 3, 2015 22:54
Nova Launcher (4.0.2) stack-trace after crash when adding a widget (Don't Keep Activities on)
09-07 23:49:00.139 31092-31092/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.teslacoilsw.launcher, PID: 31092
java.lang.RuntimeException: Unable to resume activity {com.teslacoilsw.launcher/com.teslacoilsw.launcher.NovaLauncher}: java.lang.NullPointerException: Attempt to invoke virtual method 'float[] o.eE.eN(int, int, float, float, float, float, float[])' on a null object reference
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2986)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3017)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1347)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
@markcerqueira
markcerqueira / google_groups_csv_parser.py
Created September 8, 2015 20:07
"Parser" to print out only names and emails from Google Groups "Export Members" CSV file
# google_groups_csv_parse.py
# Author: Mark Cerqueira
#
# Strips out names and emails from Google Groups members list export
#
# 1. Download CSV from Export Members option in Google Groups
# 2. Name file stanfordkendo.csv and place in same directory as this script
# 3. Run it! e.g. $ python google_groups_csv_parser.py | pbcopy
import csv
@markcerqueira
markcerqueira / .git_bash
Last active December 14, 2015 22:08
Useful git branch stuff for your bash_profile
# displays handy info when in git directories
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/'
}
function parse_hg_branch {
hg branch 2> /dev/null | sed 's/..*/\ \[&\]/'
}
function prom1 {
PS1="\w\
\$(parse_git_branch)\$(parse_hg_branch) "