Some stuff that took me longer than it should to grok, figure out, look-up or otherwise non-intuitive or radically different from Clojure.
/* http://keith-wood.name/countdown.html | |
Dutch initialisation for the jQuery countdown extension | |
Written by Mathias Bynens <http://mathiasbynens.be/> Mar 2008. | |
This is NOT for countdownjs | |
*/ | |
(function($) { | |
$.countdown.regional['nl'] = { | |
labels: ['Jaren', 'Maanden', 'Weken', 'Dagen', 'Uren', 'Minuten', 'Seconden'], | |
labels1: ['Jaar', 'Maand', 'Week', 'Dag', 'Uur', 'Minuut', 'Seconde'], | |
compactLabels: ['j', 'm', 'w', 'd'], |
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] | |
hier-part = "//" authority path-abempty | |
/ path-absolute | |
/ path-rootless | |
/ path-empty | |
URI-reference = URI / relative-ref | |
absolute-URI = scheme ":" hier-part [ "?" query ] |
#!/usr/bin/env bash % | |
# | |
# bootstrap.sh | |
# | |
# Copyright (C) 2015 Rob Jentzema <rob.jentzema@gmail.com> | |
# | |
# Distributed under terms of the MIT license. | |
# | |
# Reference(s): | |
# 1. https://github.com/clojure/clojurescript/wiki/Quick-Start |
var a = 5; | |
var b = 10; | |
var c = 2; | |
function tag(strings, ...values) { | |
console.log(strings[0].replace('\n', '')); // "Hello " | |
console.log(strings[1].replace('\n', '')); // " world " | |
console.log(values[0]); // 15 | |
console.log(values[1]); // 50 |
#!/usr/bin/env zsh | |
emulate -L zsh || return 1 | |
# Top level variables | |
eshost="http://support.internal.sevenmatches.com" | |
esport=9200 beat=(top packet file) beats=(${^beat}beat) | |
# | |
# Task handler |
CodeMirror.defineMode("clojure", function () { | |
var BUILTIN = "builtin", COMMENT = "comment", COMMENTFORM = "comment comment-form"; STRING = "string", CHAR = "char", | |
ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD = "keyword", META = "meta"; | |
var INDENT_WORD_SKIP = 2; | |
function makeKeywords(str) { | |
var obj = {}, words = str.split(" "); | |
for (var i = 0; i < words.length; ++i) obj[words[i]] = true; | |
return obj; | |
} |
(def npm (slurp "https://registry.npmjs.org/-/all/static/today.json")) | |
(distill* '[cheshire "LATEST"] {:verbose false}) | |
(require '[cheshire.core :as json]) | |
(require '[clojure.walk :refer [keywordize-keys]] | |
'[clojure.core.reducers :as r]) |
In computing, the least significant bit (LSB) is the bit position in a binary integer giving the units value, that is, determining whether the number is even or odd. The LSB is sometimes referred to as the right-most bit, due to the convention in positional notation of writing less significant digits further to the right. It is analogous to the least significant digit of a decimal integer, which is the digit in the ones (right-most) position.
It is common to assign each bit a position number, ranging from zero to N-1, where N is the number of bits in the binary representation used. Normally, this is simply the exponent for the corresponding bit weight in base-2 (such as in 231..20). Although a few CPU manufacturers assign bit numbers the opposite way (which is not the same as different endianness), the term least significant bit itself remains unambiguous as an alias for the unit bit.
By extension, the least significant bits (plural) are the bits of the number closest to, and including, the LSB.
The least
var hosts = [ | |
'hostname.mongo.server' | |
]; | |
for( var hosti in hosts ){ | |
var hostname = hosts[hosti]; | |
print(hostname); | |
var dbo = new Mongo(hostname + ":27017").getDB('test'); |