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 junit.framework.Assert | |
import org.junit.Test | |
class ExtensionMethodsTest { | |
@Test | |
def shouldBeNull() { | |
var String myTestString = null; | |
Assert::assertTrue(myTestString.isEmptyOrNull()); | |
} |
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
class PrimeSieve | |
def for(range) | |
sieve = Array(range) | |
sieve.delete 1 | |
sieve.each do |i| | |
sieve.each do |j| | |
if(i != j && j%i == 0) | |
sieve.delete(j) |
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
-(void)testThatICanMakeAWebRequest | |
{ | |
__block BOOL complete = NO; | |
__block NSString *response; | |
NSRunLoop *loop = [NSRunLoop currentRunLoop]; | |
NSURL *url = [NSURL URLWithString:@"http://some.nifty.url.com"]; | |
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
def quickSort(xs: Array[Int]) : Array[Int] = { | |
if(xs.length <= 1) xs | |
else { | |
val pivot = xs(xs.length / 2) | |
Array.concat( | |
quickSort(xs filter (pivot >)), | |
xs filter( pivot == ), | |
quickSort(xs filter (pivot <)) | |
) | |
} |
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
find . -type f | awk -F'.' '{print $NF}' | sort| uniq -c | sort -g |
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 math.BigInt | |
import math.BigInt._ | |
import util._ | |
val randomFileName = probablePrime(100,Random) toString 36 |
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
$(function () { | |
$('#foo').bind("contextmenu", function (e) { | |
e.preventDefault(); | |
alert("Copy is not allowed!"); | |
}); | |
$('#foo').bind('copy', function(e) { | |
e.preventDefault(); | |
alert("Copy is not allowed!"); | |
}); |
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
# May require | |
# Set-ExecutionPolicy Remote | |
# if Get-ExecutionPolicy returns "Restricted" | |
Set-Service W3SVC -StartupType Automatic | |
Start-Service W3SVC | |
iisreset |
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
*.csproj -text merge=union | |
*.sln -text merge=union |
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 'anemone' | |
require 'nokogiri' | |
require 'set' | |
@url = "http://my.clevelandclinic.org/default.aspx" | |
@moss_garbage = "layouts/1033/styles" | |
@css_link_set = Set.new | |
@flash_link_set = Set.new |
OlderNewer