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
jQuery.format = function(s, args) { | |
return s.replace(/\{([^}]+)\}/g, function(_, match){return args[match] || '';}); | |
}; | |
>> $.format('Hello {world}, {again}', {world: "universe", again: "testing"}); | |
"Hello universe, testing" | |
>> $.format('Hello {0}, {1}', ["foo", "bar"]); | |
"Hello foo, bar" |
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
var T = function(){ this.t = function(){return 't'} }; | |
T.prototype.tp = function(){return 'tp'}; | |
var inst = new T(); | |
console.log(inst.hasOwnProperty('t'), inst.hasOwnProperty('tp')) | |
console.log(inst.t(), inst.tp()) | |
>> true false | |
>> t tp |
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
(defun compile-cljs-on-after-save-hook () | |
(add-hook 'after-save-hook | |
'(lambda () | |
(interactive) | |
(let* ((file-name (buffer-file-name)) | |
(file-name-dir (file-name-directory file-name))) | |
(if (string-match "\.cljs$" file-name) | |
(async-shell-command | |
(concat "cljsc " file-name-dir | |
;; " '{:optimizations :advanced}' > " |
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
(select :user | |
(limit 100) | |
(using :consistency :quorum) | |
(columns [:a :b] | |
:reversed true | |
:first 100) | |
(where | |
;; simple key lookup | |
(pk 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
#!upstart | |
respawn | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
script | |
exec/usr/bin/redis-server > /dev/null 2>&1 | |
end script |
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
lamina.core.pipeline - | |
lamina.core.pipelinejava.lang.IllegalArgumentException: No | |
implementation of method: :take-contiguous-bytes- of protocol: | |
#'gloss.data.bytes.core/BufferSequence found for class: | |
clojure.lang.Cons at | |
clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:471) at | |
gloss.data.bytes.core$eval4279$fn__4365$G__4258__4372.invoke(core.clj:38) at | |
gloss.data.bytes.core$take_contiguous_bytes.invoke(core.clj:67) at | |
clojure.lang.Var.invoke(Var.java:369) at | |
gloss.data.string.codecs$take_string_from_buf_seq.invoke(codecs.clj:43) at |
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
mpenet@thinkbox:~$ sudo easy_install clojure-py | |
[sudo] password for mpenet: | |
Searching for clojure-py | |
Reading http://pypi.python.org/simple/clojure-py/ | |
Reading https://github.com/halgari/clojure-py | |
Best match: clojure-py 0.1.0 | |
Downloading http://pypi.python.org/packages/source/c/clojure_py/clojure_py-0.1.0.tar.gz#md5=794da1e8031e2d4f3fbc6484ed51c172 | |
Processing clojure_py-0.1.0.tar.gz | |
Running clojure_py-0.1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-yOz8Ho/clojure_py-0.1.0/egg-dist-tmp-P06kvb | |
Traceback (most recent call last): |
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
(defn scaffold [iface] | |
(doseq [[iface methods] (->> iface .getMethods | |
(map #(vector (.getName (.getDeclaringClass %)) | |
(symbol (.getName %)) | |
(count (.getParameterTypes %)))) | |
(group-by first))] | |
(println (str " " iface)) | |
(doseq [[_ name argcount] methods] | |
(println | |
(str " " |
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
/((?:^|$|[^&\/a-z0-9_ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþş\303\277Ѐ-ӿԀ-ԧⷠ-ⷿꙀ-ꚟᄀ-ᇿ-ㆅꥠ-가-ힰ-ᄀ-ᅵァ-ヺー-ヾヲ-゚ー0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿꜀-뜿띀-렟-﨟々〻]))(#|#)([a-z0-9_ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþş\303\277Ѐ-ӿԀ-ԧⷠ-ⷿꙀ-ꚟᄀ-ᇿ-ㆅꥠ-가-ힰ-ᄀ-ᅵァ-ヺー-ヾヲ-゚ー0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿꜀-뜿띀-렟-﨟々〻]*[a-z_ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþş\303\277Ѐ-ӿԀ-ԧⷠ-ⷿꙀ-ꚟᄀ-ᇿ-ㆅꥠ-가-ힰ-ᄀ-ᅵァ-ヺー-ヾヲ-゚ー0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿꜀-뜿띀-렟-﨟々〻][a-z0-9_ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþş\303\277Ѐ-ӿԀ-ԧⷠ-ⷿꙀ-ꚟᄀ-ᇿ-ㆅꥠ-가-ힰ-ᄀ-ᅵァ-ヺー-ヾヲ-゚ー0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿꜀-뜿띀-렟-﨟々〻]*)/gi |
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
(defmacro maybe-pipeline [& opts+stages] | |
(let [[options stages] (split-options opts+stages (meta &form))] | |
`(pipeline ~@(concat options | |
(interpose #(if (nil? %) | |
(complete nil) | |
%) | |
stages))))) |
OlderNewer