Skip to content

Instantly share code, notes, and snippets.

View gist:b0b78779ddc08edd637b
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
switch (indexPath.section) {
case 0:
{
switch (indexPath.row) {
case 0:
{
// yo dawg, i heard you like switch statements
}
}
View LocalStore.rb
class LocalStore
def self.increase_popularity(model_class_name, model_id)
key = key(model_class_name)
REDIS.pipelined do
ensure_ttl(key)
REDIS.zincrby(key, 1, model_id)
end
end
View resurrect_eratosthenes.rb
class Sieve
attr_reader :unmarked, :primes
def initialize(max)
@unmarked = (2..max).to_a
@primes = []
resurrect_eratosthenes
end