Skip to content

Instantly share code, notes, and snippets.

View raphweiner's full-sized avatar

Raphael Weiner raphweiner

View GitHub Profile
- (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
}
}
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
class Sieve
attr_reader :unmarked, :primes
def initialize(max)
@unmarked = (2..max).to_a
@primes = []
resurrect_eratosthenes
end