var aut = new AutoUpdateTime(date, function(timeDiff) {
console.log(timeDiff + ' ms passed since last callback');
});
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
contract Pyramid { | |
struct Participant { | |
bytes desc; | |
address etherAddress; | |
bytes bitcoinAddress; | |
} | |
Participant[] public participants; | |
uint public payoutIdx = 0; |
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 <> [] <>) | |
(((((((((((((((((((((((((((((((((((((((<>))))))))))))))))))))))))))))))))))))))) |
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
function cost(state) { | |
return mul( | |
b, | |
Math.log( | |
reduce( | |
add, | |
map( | |
function(x) {return Math.pow(Math.E, div(x, b))}, | |
vals(x)))))} | |
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
import {PropTypes} from 'react'; | |
import {connect} from 'react-redux'; | |
/** | |
* Enhanced version of redux' connect, that puts all action creators | |
* into the child context of the component. | |
* | |
* @param mapStateToProps {Function} | |
* @param mapDispatchToProps {Function} Must be free of side effects! | |
* @returns {Function} |
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 generate-markov-nodes | |
[words] | |
(->> | |
words | |
(map str/lower-case) | |
(str/join " ") | |
(partition 3 1) | |
(map #(list (take 2 %1) (nth %1 2))) | |
(reduce | |
(fn [acc [l next-l]] (update-in acc [l next-l] (fnil inc 0))) |
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
(ns markov-usrnames) | |
(require '[clojure.string :as str]) | |
(def file (slurp "/usr/share/dict/words" :encoding "ASCII")) | |
(def words (str/split-lines file)) | |
(defn generate-markov-nodes | |
[words] | |
(->> |
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
(ns usrnames) | |
(require '[clojure.string :as str]) | |
(def file (slurp "/usr/share/dict/words" :encoding "ASCII")) | |
(def words (str/split-lines file)) | |
(defn remove-vowels [word] | |
(->> | |
word |
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
trtht (tritheite) | |
jwstn (Jewstone) | |
hwkng (hawking) | |
plrdr (Pleurodira, pleurodire) | |
drsnz (deresinize) | |
nlwry (inlawry) | |
nrckn (unreckon) | |
bdlmc (Bedlamic) | |
mrmps (Mormoops) | |
clvry (Calvary, clovery) |
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
define([ | |
'promise' | |
], function (Promise) { | |
/** | |
* @param urlWithoutExtension {String} - the path to the sound file without a particular extension. | |
* @param audioContext {AudioContext} - the audio context of the sound file, used for decoding. | |
* @returns {Promise} - a promise containing the decoded audio data. | |
*/ | |
function getSoundBuffer(urlWithoutExtension, audioContext) { |