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
| 'use strict' | |
| const rp = require("request-promise"), | |
| url = require("url"), | |
| cheerio = require("cheerio") | |
| console.log("Init") | |
| module.exports = async (req, res) => { | |
| getMaxFromXkcd() |
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 sys | |
| import wave | |
| for arg in sys.argv[1:]: | |
| with open(arg, 'rb') as pcmfile: | |
| pcmdata = pcmfile.read() | |
| wavfile = wave.open(arg+'.wav', 'wb') | |
| # nchannels, sampwidth, framerate, nframes, comptype, compname | |
| wavfile.setparams((1, 2, 16000, 0, 'NONE', 'NONE')) | |
| wavfile.writeframes(pcmdata) |
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
| const { | |
| buffer, | |
| text, | |
| json | |
| } = require('micro') | |
| const request = require("request") | |
| if (!process.env.KEY || !process.env.CX) { | |
| throw new Error("Missing env KEY or CX"); | |
| } |
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
| window.addEventListener('load', function(){ | |
| Array.from(document.getElementsByClassName('illustration')).forEach( | |
| function(element, index, array) { | |
| var longpress = false; | |
| var presstimer = null; | |
| var startScreenX, startScreenY; | |
| var startWindowScale; |
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
| // | |
| // Written by Glenn Wiking | |
| // Script Version: 1.0.0a | |
| // Date of issue: 08/29/17 | |
| // Date of resolution: 08/29/17 | |
| // | |
| // ==UserScript== | |
| // @name ShadeRoot Pastebin | |
| // @namespace SRPB | |
| // @description Eye-friendly magic in your browser for Pastebin |
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
| private void processNluForText(@NonNull final String result) { | |
| Timber.d("processNluForText(String)"); | |
| Timber.v(result); | |
| apiAi.query(VoiceServiceStaticHelper.getRequestQueryData(getSessionId(), result, true, sharedPreferencesManager, resourcesLoader)) | |
| .compose(this.<ApiAiResponse>processNlpResponse()) | |
| .subscribe(new Subscriber<NlpResponse>() { | |
| @Override | |
| public void onCompleted() { | |
| Timber.d("NLP request completed successfully."); | |
| unsubscribe(); |
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
| private final PublishSubject<Character> testPipeline = PublishSubject.create(); | |
| private boolean flag = false; | |
| private test() { | |
| Observable.fromArray('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h') | |
| .zipWith(Observable.interval(1000, TimeUnit.MILLISECONDS), (character, aLong) -> character) | |
| .flatMap(character -> { | |
| flag = !flag; | |
| if (flag) { |