Skip to content

Instantly share code, notes, and snippets.

dataPages = [[NSArray alloc] initWithObjects:
[NSDictionary dictionaryWithObjectsAndKeys:
@"http://dribbble.com/system/users/4870/screenshots/203015/bacardi-mojito.jpg?1309590925", @"1",
@"http://dribbble.com/system/users/19849/screenshots/203160/mc-donalds-character.png?1309591886", @"1_full",
@"http://dribbble.com/system/users/4605/screenshots/202970/for_dribbble.png?1309582909", @"2",
@"http://dribbble.com/system/users/19849/screenshots/203160/mc-donalds-character.png?1309591886", @"2_full",
nil],
[NSDictionary dictionaryWithObjectsAndKeys:
@"http://dribbble.com/system/users/3460/screenshots/203157/avatar.png?1309591592", @"1",
@"http://dribbble.com/system/users/4870/screenshots/203015/bacardi-mojito.jpg?1309590925", @"2",
- (void)saveUser {
AppDelegate *delegate = (AppDelegate *) [[UIApplication sharedApplication] delegate];
[[delegate facebook] requestWithGraphPath:@"me" andDelegate:self];
}
$ ->
$(".app_url").data("timeout", null).keyup ->
url = $(this).val()
clearTimeout $(this).data("timeout")
$(this).data "timeout", setTimeout(checkForValidUrl(url), 10000)
def generate_site_code
# Remove all non letters characters
site_name = name.gsub(/[^a-zA-Z]/, '')
# Make sure the site name is at least 5 characters
site_name += Array(('a'..'z')).shuffle[0, (5 - site_name.length)].join if site_name.length < 5
# The site code is made up of the country and state code plus the first 5 characters of the site name
code = country.code[0..1] + (city.state.code? ? city.state.code[0..2] : country.description[0..2]) + site_name[0..4]
self.code = code.upcase
def active
inactive_at.nil?
end
@pnicholls
pnicholls / es.sh
Last active December 26, 2015 06:49 — forked from rajraj/es.sh
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.5.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
{"countries":[{"id":1,"code":"AU","description":"Australia"}],"meta":{"count":1,"total_count":1}}

Header 1

Header 2

Header 3 ### (Hashes on right are optional)

Header 4

Header 5

Markdown plus h2 with a custom ID ## {#id-goes-here}

Link back to H2

This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one

source 'http://rubygems.org'
ruby "1.9.3"
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
gem "rails", "3.2.16"
# Use postgres as the database for Active Record
gem "pg", "~> 0.17.0"
import Foundation
import UIKit
class FriendsViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
var user: NDUser
var friends: [NDUser]
var fetchCompleted: Bool
lazy var tableView: UITableView = {
let tableView = UITableView()