Skip to content

Instantly share code, notes, and snippets.

<!-- layout file -->
<% if current_user %>
Welcome <%= current_user.username %>. Not you? <%= link_to "Log out", logout_path %>
<% else %>
<%= link_to "Sign up", signup_path %> or <%= link_to "log in", login_path %>.
<% end %>
@rociiu
rociiu / resume.rb
Created February 21, 2011 23:32 — forked from bnadlerjr/resume.rb
require "erb"
require "ostruct"
require "optparse"
options = {}
OptionParser.new do |opts|
opts.banner = <<-DESC
Usage:
ruby resume.rb [options]
table scores:
user_id | value | score_date
1 90 2010-03-04
1 80 2009-03-04
2 90 2009-04-05
2 70 2009-05-06
3 100 2010-04-06
Find most recent scores:
(function(w, d) {
// Empty path to CSS file
// to determine later on.
var path;
// Create empty: <link rel="stylesheet" id="adaptive_css" />
var css = d.createElement('link');
css.rel = 'stylesheet';
css.id = 'adaptive_css';
function set_window_and_tab_title
{
local title="$1"
if [[ -z "$title" ]]; then
title="root"
fi
local tmpdir=~/Library/Caches/${FUNCNAME}_temp
local cmdfile="$tmpdir/$title"
//Run this code in a simulator for the iPhone and it will crash DO NOT RUN ON DEVICE, gets fscked
- (void) setAlarmOfDoom:(NSDate *)newAlarm {
{
UIApplication* app = [UIApplication sharedApplication];
// Create a new notification.
for(int i = 0; i < 10 ; i++) {
UILocalNotification* alarm = [[[UILocalNotification alloc] init] autorelease];
if (alarm)
@rociiu
rociiu / FTAccessibleActionSheet.m
Created May 4, 2011 01:32 — forked from alloy/FTAccessibleActionSheet.m
A UIActionSheet subclass that customizes the accessibility labels of the options in the sheet.
// Copyright (c) 2011 Eloy Durán <[email protected]>
// Available under the MIT license: http://www.opensource.org/licenses/mit-license.php
#import <objc/message.h>
@interface FTAccessibleActionSheet : UIActionSheet
- (void)copyAccessibilityMetadataFrom:(NSString *)title toControl:(UIView *)control;
@end
@implementation FTAccessibleActionSheet
@rociiu
rociiu / nodeconf_2011.md
Created May 7, 2011 00:48 — forked from guybrush/nodeconf_2011.md
a list of slides from nodeconf 2011