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
// There's this… | |
$(function() { | |
$('#add-entry').attr('id', 'add-member').click(function() { | |
$('#edit').remove(); | |
$(this).after( | |
$('<input>', { | |
type: 'submit', | |
name: 'add', |
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
<?php | |
// Made by Ross Penman (@PenmanRoss, rosspenman.com) | |
ob_implicit_flush(); | |
$words = trim(file_get_contents("/usr/share/dict/words")); | |
$words = explode("\n", $words); | |
$sorted_words = array(); |
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 <Foundation/Foundation.h> | |
@interface RAPQueueManager : NSObject | |
{ | |
NSMutableDictionary *queues; | |
} | |
@property (retain) NSString *label; | |
- (id)initWithLabel:(NSString *)label; |
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
Pod::Spec.new do |s| | |
s.name = "SWRevealViewController" | |
s.version = "0.0.2" # totally arbitrary. | |
s.summary = "A UIViewController subclass for presenting two view controllers inspired in the FaceBook app, done right." | |
s.homepage = "https://github.com/John-Lluch/SWRevealViewController" | |
s.license = "BSD" | |
s.author = { "John Lluch Zorrilla" => "[email protected]" } | |
s.source = { :git => "https://github.com/John-Lluch/SWRevealViewController.git", :commit => "e82eb22a4c3a0d134b1ea317b904e042605544e2" } |
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 'net/http' | |
require 'json' | |
puts "" | |
MAX = 50 * 10 ** 9 # 50 billion | |
# Get the URL of the JSON in case Apple changes it. | |
url = URI.parse 'http://images.apple.com/v/itunes/shared/counter/a/scripts/counter.js' | |
req = Net::HTTP::Get.new url.path |
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
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
CGFloat TEXT_VIEW_MARGIN_X = 14; // gap between edge of cell and edge of text view | |
CGFloat TEXT_VIEW_INSET_X = 5; // gap between edge of text view and text inside | |
CGFloat TEXT_VIEW_INSET_Y = 9; // gap between top/bottom of text view and text inside | |
NSString *text = [self lorem]; | |
CGSize constraint = CGSizeMake(tableView.bounds.size.width - (TEXT_VIEW_MARGIN_X + TEXT_VIEW_INSET_X) * 2, CGFLOAT_MAX); | |
CGSize size = [text boundingRectWithSize:constraint options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:17]} context:nil].size; |
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
var request = require("request"); | |
var _ = require("underscore"); | |
var fs = require("fs"); | |
var usernames = []; | |
var REQS = 100; | |
for (var i = 0; i < REQS; i++) { | |
request("http://api.randomuser.me?results=5", function(response, error, body) { |
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
THIS IS FUN |
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
var async = require("async"), | |
request = require("request"), | |
_ = require("lodash"), | |
cheerio = require("cheerio"); | |
var get = function(url, callback) { | |
request(url, function(error, response, body) { | |
if (error) { | |
console.error(error); | |
return; |
OlderNewer