I hereby claim:
- I am taylorlapeyre on github.
- I am taylorlapeyre (https://keybase.io/taylorlapeyre) on keybase.
- I have the public key with fingerprint AB1B EBEC F0DA 3CC9 43FA 73B4 A5FE F98C 15EF B3F2
To claim this, I am signing this object:
it 'should be able to tell whether any open studios are visible' do | |
@open_studio.sticker_image = 'sticker image url' | |
@open_studio.active_rule = 'show_sticker' | |
expect(@open_studio.save).to be_true | |
expect(OpenStudio.active).to_not be_nil | |
end |
I hereby claim:
To claim this, I am signing this object:
class SpanishTutor | |
def initialize(path_to_dictionary) | |
@dictionary = parse_file(path_to_dictionary) | |
@num_incorrect = 0 | |
@num_correct = 0 | |
start_repl | |
end | |
def start_repl | |
loop do |
/* | |
* int i = 0; | |
* int nl = 0; | |
* while (S[i]) { | |
* if (S[i] > 97 && S[i] < 122) { | |
* nl++; | |
* } | |
* i++; | |
* } | |
*/ |
getStuff = function() { | |
return { | |
url: window.location.href, | |
name: $('.full-name').html(), | |
title: $('.title').html(), | |
date: new Date(), | |
} | |
} |
(defn abs [x] | |
"Returns x if the number is > 0, otherwise -x" | |
(if (neg? x) (- x) x)) | |
(defn square [x] | |
"Squares the number" | |
(* x x)) | |
(defn cube [x] | |
"Multiplies the square of the number by itself" |
Say that one day we decide to write a new templating library for generating HTML.
In this new library, you are passed an array where the first element is the name of an HTML tag, the second element is optionally a hash containing the element's HTML attributes, and the rest of the elements are the HTML elements that are children of it.
For example:
html = [:html,
#!/usr/bin/env bash | |
LEIN_URL=https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein | |
function execute_clojure { | |
if [[ -d $HOME/.lein ]]; then | |
if [[ ! -f $HOME/.lein/profiles.clj ]]; then | |
echo '{:user {:plugins [[lein-exec "0.3.4"]]}}' > $HOME/.lein/profiles.clj | |
fi | |
else |
(defn divisible? | |
"Returns true if the remainder of x / y is zero, else false." | |
[x y] | |
(zero? (rem x y))) | |
(defn fizzbuzz | |
"Returns Fizz if n is divisible by 3, buzz if n is divisible by 5, | |
and fizzbuzz if n is divisible by both." | |
[n] | |
(cond (divisible? n 15) "fizzbuzz" |