Skip to content

Instantly share code, notes, and snippets.

View NSArray+CollectionOperations.h
//
// NSArray+CollectionOperations.h
// MSAppKit
//
// Created by Jarod Luebbert on 1/4/13.
//
//
#import <Foundation/Foundation.h>
View find_odd_retina_images.py
"""
List all retina assets (@2x) that have odd dimensions.
------------------------------------------------------
"""
import os
from re import search
from PIL import Image
from argparse import ArgumentParser
View scramble.py
def read_input(input_filename="input.txt"):
with open(input_filename) as f:
return (line.rstrip().split(' ') for line in f.readlines())
def scramble_word(word):
if len(word) > 3:
from random import shuffle
middle = list(word[1:-1])
shuffle(middle)
new_word = word[0] + str.join('', middle) + word[-1]
View cycles.py
"""
Detecting cycles
----------
Solution for the cycles challenge.
"""
def read_input(input_filename="input.txt"):
with open(input_filename) as f:
return (line.rstrip().split() for line in f.readlines())
View output.txt
The longest length found was: 15
The first longest substring was: rustlingofeachp
python substring.py 28.60s user 27.93s system 99% cpu 56.831 total
View NSString+charactersAsArray.h
#import <Foundation/Foundation.h>
@interface NSString (charactersAsArray)
- (NSArray *)charactersAsArray;
@end
View GFFParallaxNode.h
//
// GFFParallaxNode.h
//
// Created by Rolando Abarca on 12/14/09.
//
#import <Foundation/Foundation.h>
#import "cocos2d.h"
#define MAX_PARALLAX_CHILDREN 25
View generateSpritesheets.py
#!/usr/bin/env python
import os
from subprocess import call
SPRITESHEET_SRC_DIR='Resources/Spritesheet Sources'
SPRITESHEET_DST_DIR='Generated/Spritesheets'
TEXTURE_PACKER='Tools/TexturePacker.app/Contents/MacOS/TexturePacker'
def main():
@jarodl
jarodl / CCDrawingPrimitives+ccDrawFillCircle.h
Created Sep 21, 2011
CCDrawingPrimitives+ccDrawFillCircle
View CCDrawingPrimitives+ccDrawFillCircle.h
//
// CCDrawingPrimitives+ccDrawFillCircle.h
// MindSnacks
//
// Created by Jarod L on 9/20/11.
// Copyright (c) 2011 MindSnacks. All rights reserved.
//
#import "CCDrawingPrimitives.h"
View gist:1005648
{
"from_user_id_str": "21640",
"profile_image_url": "http://a2.twimg.com/profile_images/1133121379/me-summer2010_normal.jpg",
"created_at": "Thu, 02 Jun 2011 19:38:05 +0000",
"from_user": "amrox",
"id_str": "76372030727004160",
"metadata": {
"result_type": "recent"
},
"to_user_id": null,