Skip to content

Instantly share code, notes, and snippets.

Object Graph Serialization File Size Comparison

  • Update: Added tbuf, broke out tables, you can use https://github.com/schwa/transmogrifier to convert between msgpack, yaml, bson, json and xml plists

  • Update: Added bencode, renamed tbuf to yabon

  • Update: Added disclamer, added pickle

@masbog
masbog / color.m
Created September 17, 2012 08:41 — forked from kylefox/color.m
Generate a random color (UIColor) in Objective-C
CGFloat hue = ( arc4random() % 256 / 256.0 ); // 0.0 to 1.0
CGFloat saturation = ( arc4random() % 128 / 256.0 ) + 0.5; // 0.5 to 1.0, away from white
CGFloat brightness = ( arc4random() % 128 / 256.0 ) + 0.5; // 0.5 to 1.0, away from black
UIColor *color = [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:1];
@masbog
masbog / floatsign.sh
Created October 18, 2012 11:40 — forked from mediabounds/floatsign.sh
A small bash script to re-sign iOS applications.
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@masbog
masbog / captcha.md
Created October 20, 2012 12:21 — forked from Samuirai/captcha.md
G-WAN Captcha Decode

G-WAN is a new free web server. They seem to be very proud of it, or at least just want to make a lot of money. Well anyway, in almost every sentence they write, they claim that they are 20% cooler than anything else. It feels a bit arrogant. I have to admit, I don't know a lot about web servers, so I can't speak to how good they are.

However, then I saw their Captcha example. I also don't know much about machine learning algorithms, OCR, and stuff like that, but I do know how to read pixels. I also know how to compare values with python :P

demo

They say the following about their Captcha:

@interface UILabelStrikethrough : UILabel {
int xOffset;
int yOffset;
int widthOffset;
int stroke;
UIColor* strokeColor;
}
@property (nonatomic) int xOffset;
@property (nonatomic) int yOffset;
@property (nonatomic) int widthOffset;
@masbog
masbog / dedup.py
Created February 18, 2013 09:07 — forked from plamere/dedup.py
#!/usr/bin/python
import sys
import os
import pprint
import subprocess
import pickle
import atexit
import simplejson as json
sys.path.insert(0, "../API")
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh
@masbog
masbog / dedup.py
Created February 18, 2013 17:34 — forked from plamere/dedup.py
#!/usr/bin/python
import sys
import os
import pprint
import subprocess
import pickle
import atexit
import simplejson as json
sys.path.insert(0, "../API")
//
// Copyright (c) 2012-2013 Cédric Luthi / @0xced. All rights reserved.
//
#if TARGET_IPHONE_SIMULATOR
static const char *fakeCarrier;
#import <objc/runtime.h>

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: