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
// Playground - noun: a place where people can play | |
import UIKit | |
let b = [1, 2, 3][1..2].filter { $0 < 3 } | |
let c = b + [5, 6] | |
func quicksort<T : Comparable>(arr : Array<T>) -> Array<T> { | |
if arr.count <= 1 { | |
return arr |
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 string | |
class Solution: | |
# @param start, a string | |
# @param end, a string | |
# @param dict, a set of string | |
# @return an integer | |
def ladderLength(self, start, end, dict): | |
dict += [end] |
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
/** | |
* CSV Parser. Takes a string as input and returns | |
* an array of arrays (for each row). | |
* | |
* @param input String, CSV input | |
* @param separator String, single character used to separate fields. | |
* Defaults to "," | |
* @param quote String, single character used to quote non-simple fields. | |
* Defaults to "\"". | |
*/ |
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
#!/bin/bash | |
# git-interactive-merge | |
# Taken from: http://www.angrylibertarian.com/node/53 | |
from=$1 | |
to=$2 | |
if [[ ( -z $from ) || ( -z $to ) ]]; then | |
echo "Usage:" | |
echo " git-interactive-merge <from-branch> <to-branch>" | |
exit 1 |
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
#!/bin/bash | |
# Check if GRAILS_PREFIX is set | |
if [ -z $GRAILS_PREFIX ]; then | |
echo "You must define environment variable GRAILS_PREFIX before running Automatic Grails Version Selector" | |
exit 1 | |
fi | |
# Define script params array | |
declare -a PARAMS |
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 org.codehaus.groovy.grails.commons.GrailsClassUtils as GCU | |
import org.springframework.orm.hibernate3.SessionFactoryUtils | |
import org.springframework.orm.hibernate3.SessionHolder | |
import org.springframework.transaction.support.TransactionSynchronizationManager | |
includeTargets << grailsScript("_GrailsBootstrap") | |
includeTargets << grailsScript("_GrailsRun") | |
includeTargets << grailsScript("_GrailsSettings") | |
includeTargets << grailsScript("_GrailsClean") |
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
/* | |
* twitter-entities.js | |
* This function converts a tweet with "entity" metadata | |
* from plain text to linkified HTML. | |
* | |
* See the documentation here: http://dev.twitter.com/pages/tweet_entities | |
* Basically, add ?include_entities=true to your timeline call | |
* | |
* Copyright 2010, Wade Simmons | |
* Licensed under the MIT license |
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
Feature: Addition | |
In order to avoid silly mistakes | |
As a math idiot | |
I want to be told the sum of two numbers | |
Scenario: Add two numbers | |
Given I visit the calculator page | |
And I fill in '50' for 'first' | |
And I fill in '70' for 'Second' | |
When I press '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
Addition { | |
In order to avoid silly mistakes | |
As a math idiot | |
I want to be told the sum of two numbers | |
Add two numbers { | |
Given I visit the calculator page { visit '/add' } | |
And I fill in '50' for 'first' { fill_in('first', 50) } | |
And I fill in '70' for 'Second' { fill_in('Second', 70) } | |
When I press 'Add' { click_button '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
#import <extThree20JSON/extThree20JSON.h> | |
#import <extThree20JSON/NSObject+SBJSON.h> | |
@interface JSONPResponse : TTURLJSONResponse { | |
} | |
@end |
OlderNewer