I hereby claim:
- I am miloshadzic on github.
- I am miloshadzic (https://keybase.io/miloshadzic) on keybase.
- I have a public key ASA86E5jWs3Z519MuxyoN4NYOyoTMbvfkA65CjAoRlvALQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
rsync -vrh --progress -e "ssh -T -c arcfour -o Compression=no -x" <source> <destination> |
#reduce(function, sequence) | |
print reduce(lambda x, y: x+y, range(1,11)) | |
def red(funct, seq): | |
for x in seq: #do this for every x in this list | |
return funct(seq) # ovde ti je greska zbog toga sto ce ovaj return da vrati | |
# rezultat poziva funct(seq) vec na prvom elementu. Probaj da prvo napravis | |
# promenljivu u kojoj ces drzati rezultat. To ti je "akumulator". Dodatni hint |
/// Retrieves a value for the given key. A passed default value is | |
/// returned if the key is not present. | |
pub fn get_or_default<'a>(&'a self, k: &K, default: &V) -> &'a V { | |
match self.find(k) { | |
Some(v) => v, | |
None => default | |
} | |
} |
pub fn get<'a>(&'a self, k: &K) -> &'a V { | |
match self.find(k) { | |
Some(v) => v, | |
None => fail!("No entry found for key: %?", k), | |
} | |
} |
def score dice | |
{1 => 100, 2 => 0, 3 => 0, 4 => 0, 5 => 50, 6 => 0}.map do |(n, score)| | |
occurences = dice.count n | |
(occurences / 3) * (n == 1 ? 1000 : n * 100) + (occurences % 3) * score | |
end.reduce :+ | |
end |
class A;end | |
module B | |
def hello | |
puts "hello" | |
end | |
end | |
A.hello => NoMethodError |
user=> (clojure.string/join ["a" "b" "c" "d"]) | |
"abcd" | |
user=> (clojure.string/join ", " ["a" "b" "c" "d"]) | |
"a, b, c, d" |
# AMD require sugared syntax | |
# http://requirejs.org/docs/whyamd.html#sugar | |
# Works better when there are many dependencies | |
# Before | |
define ['backbone'], (Backbone) -> | |
class Table extends Backbone.model | |
# After | |
define (require) -> |
({ | |
baseUrl: 'app', | |
out: 'build/main.js', | |
optimize: 'uglify2', | |
name: 'libs/almond', | |
include: ['main'], | |
exclude: ['coffee-script'], | |
stubModules: ['cs', 'text'], |