Skip to content

Instantly share code, notes, and snippets.

describe("In the project details page", function () {
var TestTools = require('./TestTools'),
Navigation = require('./Navigation'),
ptor;
beforeEach(function () {
TestTools.resetTestData();
ptor = protractor.getInstance();
ptor.get('/ebo/#/projects/excecutive-education');
var TestTools = {
// some other helpers
// ...
clickDropdownOptionWithGivenValue: function (
selectId, optionValue) {
element(by.css('#' + selectId)).click();
return element(
by.xpath(
(ns berlin_clock.t-core
(:use midje.sweet)
(:use [berlin_clock.core]))
(use '[clojure.string :only (join)])
(facts "about Berlin Clock"
(facts "seconds lamp"
(fact "It turns on for one second (Y)"
(show "00:00:00") => (join "\n"
(ns berlin_clock.core)
(use '[clojure.string :only (join split)])
(defn show [time]
(let
[[h m s] (map #(Integer. %) (split time #":"))
turn-on-red (fn [num-lamps] (repeat num-lamps "R"))
@trikitrok
trikitrok / 0_reuse_code.js
Created June 17, 2014 18:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@trikitrok
trikitrok / deleteAllMp4WithSpacesInNames.sh
Created June 17, 2014 18:29
It deletes all the mp4 files found under the current folder. -print0 and -0 to avoid that a space in a filename is used as a delimiter -> Explained in http://stackoverflow.com/questions/16758525/how-to-use-xargs-with-filenames-containing-whitespaces
find . -name *.mp4 -print0 | xargs -0 rm
@trikitrok
trikitrok / deleteBranch.sh
Created June 18, 2014 11:06
Deleting a remote branch
git push origin --delete <branch-name>
(ns dna)
(def dna-nucleotides #{\A, \T, \C, \G})
(def nucleotides (conj dna-nucleotides \U))
(defn nucleotide-counts [strand]
(let
[counted-nucleotides
(zipmap dna-nucleotides (repeat (count dna-nucleotides) 0))
(ns dna)
(defn hamming-distance [strand1 strand2]
(reduce
+
(map
(fn [base1 base2]
(if (= base1 base2) 0 1))
strand1
strand2)))
(ns phone)
(defn extract-digits [phone-number]
(let
[digits (filter #(Character/isDigit %) phone-number)
digits-length (count digits)]
(cond
(= digits-length 10) digits
(and (= digits-length 11)
(= (first digits) \1)) (rest digits)