Skip to content

Instantly share code, notes, and snippets.


Daniel Ferreira theiostream

View GitHub Profile
theiostream /
Created Dec 7, 2019
Tentatively converts IdeaList .TEX file to CSV
# converts Blackwell IdeaList .TEX file to CSV
# (c) 2019 Daniel Ferreira
from array import array
from datetime import date
import csv
theiostream /
Last active Aug 6, 2021
GSoC '17 Product - GNUstep - "Make WebCore run on top of GNUstep"

Here follows a list of patches submitted to GNUstep:

New libraries

gnustep-boron (a reimplementation of some non-deprecated Carbon APIs)

All work on this library is part of this GSoC project. This project contains stubs and a working reimplementation of macOS Universal Type

theiostream / git2cl
Last active Jun 25, 2017
Turn a git log into a GNUstep-like ChangeLog (based on
View git2cl
# Copyright (C) 2007, 2008 Simon Josefsson <>
# Copyright (C) 2007 Luis Mondesi <>
# * calls git directly. To use it just:
# cd ~/Project/my_git_repo; git2cl > ChangeLog
# * implements strptime()
# * fixes bugs in $comment parsing
# - copy input before we remove leading spaces
# - skip "merge branch" statements as they don't
theiostream /
Created Dec 11, 2013
Not so smart Tic Tac Toe implementation in Java. Has a pretty flawed AI (which also happens to rely on bruteforce.)
import java.util.Scanner;
public class SmartTTT {
private static int[][] t;
private static int lx, ly;
public static final int INFINITY = 2; // this is sad.
private static char ti(int i) {
char ret;
theiostream / Pair.m
Created Nov 10, 2013
A pretty simple/dumb Objective-C pair object.
View Pair.m
@interface Pair : NSObject {
id obj1;
id obj2;
- (id)initWithObjects:(id)object, ...;
@implementation Pair
- (id)initWithObjects:(id)object, ... {
theiostream / CountryCode.h
Created Jun 26, 2013
Get a country code from Apple's StoreFront IDs.
View CountryCode.h
// CountryCode.h
// (c) 2013 Bacon Coding Company, LLC.
// Licensed under the MIT License.
// I lost my time scripting this dictionary in Python than I'd have writing it.
// Regardless, it was some fun.
#import <Foundation/Foundation.h>
// Reference:
theiostream / URLEncode.m
Last active Dec 11, 2015
URL-Encode NSStrings and NSDictionaries.
View URLEncode.m
// From Cocoanetics (s/&amp/&)
static NSString *NSStringURLEncode(NSString *string) {
return [(NSString *)CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)string, NULL, CFSTR("!*'();:@&;=+$,/?%#[]"), kCFStringEncodingUTF8) autorelease];
static NSString *NSDictionaryURLEncode(NSDictionary *dict) {
NSMutableString *ret = [NSMutableString string];
NSArray *allKeys = [dict allKeys];
for (NSString *key in allKeys) {
theiostream /
Created Jan 24, 2013
Installs the iOS SDK without headers.
## Installs an sdk from a dyld decache plus some goodies.
## Slightly based on BigBoss's installsdk3.
## Created by theiostream. Public Domain.
## - Uses the latest on-device frameworks/libraries
## - Is completely legal
View cachecopier.m
// cachecopier.m
// Copy the dyld_shared_cache into /var/tmp.
// Credits to planetbeing for the ASLR trick and theiostream for implementation.
// arm-apple-darwin10-llvm-gcc-4.2 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -framework Foundation -mdynamic-no-pic -o cachecopier cachecopier.m
#import <Foundation/Foundation.h>
int main() {
theiostream / ChangeColor.m
Last active Dec 10, 2015
Change UIImage's color
View ChangeColor.m
// Heavily based on by Dan Rosenstark
// Fix for monochrome model on the comment on the same post by Ben Cunningham
// Removal of unneeded code by Daniel Ferreira (theiostream).
static UIImage *UIImageChangeColor(UIImage *image, UIColor *color_) {
CGColorRef color = [color_ CGColor];
CGRect contextRect = (CGRect){CGPointZero, [image size]};
CGContextRef ctx = UIGraphicsGetCurrentContext();