This file contains hidden or 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
primes = [2] | |
count = 1 | |
prime_candidate = 2 | |
start = Time.now() | |
until (count == 10001) do | |
prime_candidate +=1 | |
while (true) do | |
psqrt = Math.sqrt(prime_candidate) | |
unless primes. | |
find do |prime| |
This file contains hidden or 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
num = <<NUM | |
73167176531330624919225119674426574742355349194934 | |
96983520312774506326239578318016984801869478851843 | |
85861560789112949495459501737958331952853208805511 | |
12540698747158523863050715693290963295227443043557 | |
66896648950445244523161731856403098711121722383113 | |
62229893423380308135336276614282806444486645238749 | |
30358907296290491560440772390713810515859307960866 | |
70172427121883998797908792274921901699720888093776 | |
65727333001053367881220235421809751254540594752243 |
This file contains hidden or 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
{ | |
"metadata" : { | |
"created" : "2013-10-17 13:45:20", | |
"author" : "Tony Brouwer" | |
}, | |
"data" : { | |
[ | |
{ | |
"oen" : 123456, | |
"action" : "update", |
This file contains hidden or 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
package ca.ontario.moh.stix.loadfile; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
/** | |
* Decrypt file using 7zip | |
* | |
*/ |
This file contains hidden or 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
1.upto(100).each do |x| | |
s = "" | |
s+= 'fizz' if (x % 3 == 0) | |
s += 'buzz' if (x % 5 == 0) | |
s = x.to_s if (s.empty?); | |
puts s | |
end |
This file contains hidden or 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
doskey subl="C:\Program Files\Sublime Text 2\sublime_text.exe" $* |
This file contains hidden or 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
walls = [2,5,1,2,3,4,7,7,6] | |
# array of max values of elements to the left for each element | |
def running_max(_walls) | |
maxmin = 0 | |
_walls.inject([]) do |maxes, c| | |
maxes << if (c < maxmin) then | |
maxmin | |
else | |
maxmin = c |
This file contains hidden or 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
' Alt-F11 in Word to get into VBA mode | |
' Then Insert>>Module | |
' Paste this in and Run | |
Public Sub CreateOutline() | |
Dim docOutline As Word.Document | |
Dim docSource As Word.Document | |
Dim rng As Word.Range | |
Dim astrHeadings As Variant |
This file contains hidden or 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
docker rm -vf $(docker ps -a -q) |
This file contains hidden or 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
buildscript { | |
ext { | |
springBootVersion = '1.5.9.RELEASE' | |
} | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") | |
} |