This file contains 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 f = function() { | |
var v = speechSynthesis.getVoices().filter(function(v) { return v.name == 'Hysterical'; })[0], | |
s = ["ahahahaha", "stop it", "don't tickle me"], | |
t = new SpeechSynthesisUtterance(s[~~(Math.random()*s.length)]); | |
t.voice = v; speechSynthesis.speak(t); | |
}; | |
Array.prototype.slice.call(document.querySelectorAll('a')).forEach(function(a) { | |
a.addEventListener('mouseover', f); | |
}); |
This file contains 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
require 'jsgf' | |
module JSGF | |
class Grammar | |
# Convert a {Grammar} into a set of sample utterances for Alexa | |
# @option slots [Array] The rule names that should be used as slot names | |
# @return [Array<String>] An array of the example strings | |
def to_examples(slots:[]) | |
raise StandardError, "The grammar must have at least one root rule" unless roots | |
raise StandardError, "The grammar must contain at least one public rule" if roots.empty? |
This file contains 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
// Adapted from http://learningthreejs.com/blog/2013/09/16/how-to-make-the-earth-in-webgl/ | |
(function () { | |
/** | |
* @typedef {GeoVizOptions} | |
* @type {Object} | |
* @property {} ... | |
*/ | |
/** |
This file contains 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
#include "pebble_os.h" | |
#include "pebble_app.h" | |
#include "pebble_fonts.h" | |
#include "http.h" | |
/* If compiling this for iOS, set ANDROID to be false. */ | |
#define ANDROID true | |
#if ANDROID | |
#define MY_UUID { 0x91, 0x41, 0xB6, 0x28, 0xBC, 0x89, 0x49, 0x8E, 0xB1, 0x47, 0x10, 0x34, 0xBF, 0xBE, 0x12, 0x98 } |
This file contains 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
'''Visualization of Satoshi's BuildMerkleTree for issue #4926. | |
Usage: merkle.py <num> | |
''' | |
from __future__ import print_function, division | |
import itertools | |
def build_merkle_tree(num): | |
'''Build a Merkle tree according to Satoshi''' | |
vtx = [('%2i'%(x+1)) for x in range(num)] |
This file contains 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.prototype.bind=(function(){}).bind||function(b){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");}function c(){}var a=[].slice,f=a.call(arguments,1),e=this,d=function(){return e.apply(this instanceof c?this:b||window,f.concat(a.call(arguments)));};c.prototype=this.prototype;d.prototype=new c();return d;}; |
This file contains 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
package main | |
import ( | |
"fmt" | |
"encoding/json" | |
"math/big" | |
"os" | |
) | |
type dc struct { |
This file contains 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
{"messageHeader":{"deviceContext":[{"name":"playbackState", "namespace":"AudioPlayer", "payload":{"streamId":"", "offsetInMilliseconds":"0", "playerActivity":"IDLE"}}]}, "messageBody":{"profile":"doppler-scone", "locale":"en-us", "format":"audio/L16; rate=16000; channels=1"}} |
This file contains 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
#!/usr/bin/env python | |
import struct | |
def rightrotate(i, n, wsize): | |
return ((i << (wsize-n)) & (2**wsize-1)) | (i >> n) | |
class SHA2(object): | |
"""Abstract class for SHA-2 variants""" | |
def __init__(self): |
This file contains 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 http = require('https'); | |
var querystring = require('querystring'); | |
// set the post request options | |
var reqOptions = { | |
hostname: 'hooks.slack.com', | |
port: 443, | |
path: '/services/YOUR/SLACK/HOOK_HERE', | |
method: 'POST' | |
}; |
OlderNewer