Simple fuzzy–matching of NSStrings, ignoring case, diacritics, and position in the string being searched. Based on a blog post by @rwenderlich, Apple’s documentation, and banging my keyboard until it works.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
# url dsl -- the ultimate url dsl! | |
# | |
# You just can't beat this: | |
# | |
# $ irb -r url_dsl | |
# >> include URLDSL | |
# => Object | |
# >> http://github.com/defunkt.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://gallery.me.com/flpatriot/100009?webdav-method=truthget&feedfmt=json | |
{ | |
"records": [ | |
{ | |
"viewIdentifier" : 2, | |
"numMovies" : 0, | |
"allowsVideoContent" : true, | |
"showMobile" : false, | |
"download" : false, | |
"path" : "http://gallery.me.com/flpatriot/100009", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# system paths & enviroment variables | |
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH" | |
## subversion status | |
svn_status() { | |
local DIRTY REV=$(svn info 2>/dev/null | grep Revision | sed -e 's/Revision: //') | |
[ "$REV" ] || return | |
[ "$(svn st)" ] && DIRTY=' *' | |
echo "[r$REV$DIRTY]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# open a hash of FasterCSV generators | |
data = { :table1 => nil, :table2 => nil, :table3 => nil, :table4 => nil } | |
data[:table1] = FasterCSV.generate do |data[:table1]| | |
data[:table2] = FasterCSV.generate do |data[:table2]| | |
data[:table3] = FasterCSV.generate do |data[:table3]| | |
data[:table4] = FasterCSV.generate do |data[:table4]| | |
# do stuff with it | |
# close them, rewriting the data to CSV inside the same hash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def clear | |
puts `clear` | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf8 -*- | |
from flask import Flask, redirect, url_for | |
from markdown import markdown | |
import os | |
import re | |
# create the app | |
# TODO: load config/template from files, with fallbacks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!DEVICE_IS_IPAD) { | |
// nobody loves you | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation NSObject (Evil) | |
- (id)init { | |
return nil; | |
} | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
// Including the .h and .m file together for simplicity’s sake. | |
// yes, this is a horrific abuse of ObjC | |
@interface CSTextCell : UITableViewCell { | |
} | |
+ (id)generate:(UITableView *)tableView at:(NSIndexPath *)indexPath text:(NSString *)text; | |
+ (NSString *)cellID; |
OlderNewer