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

ƗƗɑƗƗɑƗƗɑ
(Ơ̴̴̴̴̴̴͡.̮Ơ̴̴͡)
(⌣́_⌣̀)
ƪ(˘⌣˘)┐ ƪ(˘⌣˘)Ʃ ┌(˘⌣˘)Ʃ
<( ‾^‾)--O)'` .̮´)ː̖́
(>_<)○--(^o^)○
(˛•̃•̃)/\(•̃•̃¸)
(˘̩̩̩.˘̩ƪ)
ƪ(♥ε♥)ʃ
(˘⌣˘)ε˘`)
@masbog
masbog / epoc.h
Created October 25, 2011 04:53
epoc time convert to string
- (NSString*)getDate:(int)time
{
NSMutableString *since = [[[NSMutableString alloc] initWithCapacity:0] autorelease];
NSDate *dateNow = [NSDate date];
NSTimeZone *localeTimeZone = [NSTimeZone localTimeZone];
int timeZoneOffset = [localeTimeZone secondsFromGMT];
int epochnow = [dateNow timeIntervalSince1970];
int when = epochnow - time - timeZoneOffset;
int day = when / 86400;
int dayreminder = when % 86400;
@masbog
masbog / RadioIndoOnLine
Created January 11, 2012 03:26
Radio list using PHP (json)
<?php
header('Content-type: application/json');
if($_GET['list'] == 'jogjastreamers')
{
$url = 'http://www.jogjastreamers.com/m/radiolist_ipad.php';
//open connection
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
@masbog
masbog / karma.php
Created March 26, 2012 21:14
Who Not Following Back You algorith on Twitter
<?php
require_once('twitteroauth/twitteroauth.php');
define('CONSUMER_KEY', '');
define('CONSUMER_SECRET', '');
define('ACCESS_TOKEN', '');
define('ACCESS_TOKEN_SECRET', '');
$twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
@masbog
masbog / sampleCache.m
Created April 24, 2012 15:12
Save image into temporary directory iOS
#define TMP NSTemporaryDirectory()
- (NSString*)setFileName:(NSString*)url
{
NSArray *tokenize = [url componentsSeparatedByString: @"/"];
NSString *imageFile = [tokenize objectAtIndex:([tokenize count]-1)];
//NSLog(@"%@",imageFile);
return imageFile;
}
@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;