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
function fbSave(result, collection) { | |
if (result.data) { | |
for (i in result.data) { | |
db[collection].save(result.data[i]); | |
} | |
return result.data.length; | |
} else { | |
db[collection].save(result); | |
return 1; |
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
function structure(anObject, maxDepth) { | |
if (maxDepth < 1) { | |
return Array.isArray(anObject) | |
? [] | |
: typeof(anObject) === "object" | |
? {} | |
: typeof(anObject); | |
} | |
var clone; |
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
/* Initialise all rearrangement matrices */ | |
lowerX = new RearrangeMatrix(data.getLowerX()); | |
lowerY = new RearrangeMatrix(data.getLowerY()); | |
upperX = new RearrangeMatrix(data.getUpperX()); | |
upperY = new RearrangeMatrix(data.getUpperY()); | |
ExecutorService executor = Executors.newFixedThreadPool(2); | |
for (final RearrangeMatrix matrix : new RearrangeMatrix[]{lowerX, lowerY, upperX, upperY}) { | |
executor.execute(new Runnable() { |
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
# Create the directory and make sure | |
mkdir -p ~/.git-template/hooks | |
# Create a post-commit file in that directory and feed it the commit-hook: | |
cat > ~/.git-template/hooks/post-commit << EOF | |
#!/usr/bin/env ruby | |
file="~/.gitshots/#{Time.now.to_i}.jpg" | |
unless File.directory?(File.expand_path("../../rebase-merge", __FILE__)) | |
puts "Taking capture into #{file}!" | |
system "imagesnap -q -w 3 #{file} &" |
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
{ | |
"testResult": { | |
"name": "My test", | |
"status": "PASSED", | |
"id": "e93e081a-7d77-4689-9728-9c2bc1b51983" | |
} | |
} |
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
{ | |
"testStarted": { | |
"name": "My test suite", | |
"id": "8f22cce8-c281-456e-a2ef-54a863a0ccdd" | |
} | |
} | |
{ | |
"testStarted": { | |
"name": "My test", | |
"parentId": "8f22cce8-c281-456e-a2ef-54a863a0ccdd", |
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
module Pages.SearchPage.Rest exposing (..) | |
import Html exposing (..) | |
import Http | |
import Json.Decode as JD exposing (..) | |
import Pages.SearchPage.Types exposing (Model, ImagePic, Msg) | |
import Json.Decode.Pipeline as JP | |
import RemoteData | |
fetchImagePics : Cmd Msg |
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
module Random.Insertion exposing (..) | |
import Benchmark exposing (..) | |
import Benchmark.Runner exposing (BenchmarkProgram, program) | |
import Char | |
import Dict | |
import Dict.AVL as AvlDict | |
import Time exposing (Time) | |
import Random.Pcg as Random exposing (int, list, Seed) |
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
module Test exposing (..) | |
{-| A binary search tree will often look roughly like this. | |
Every node will either be the `Empty` node, or a node with | |
a key, a value and left and right children. In this case, we | |
also have an extra `Int` to keep track of the height, but | |
that's not relevant to the example at hand. | |
-} | |
type Dict k v | |
= Empty |
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
isValidBst : Tree comparable -> Bool | |
isValidBst tree = | |
case tree of | |
Empty -> | |
True | |
Node value left right -> | |
all (\x -> x < value) left | |
&& all (\x -> x > value) right | |
&& isValidBst left |