Skip to content

Instantly share code, notes, and snippets.

View jochemstoel's full-sized avatar
💭
Dematerializing

Jochem Stoel jochemstoel

💭
Dematerializing
View GitHub Profile
@jochemstoel
jochemstoel / gist:0a222974a682a16af53ded466e472ccc
Created April 12, 2018 20:09 — forked from samhernandez/gist:5260558
Get an RSS pubDate from a Javascript Date instance.
/**
* Get an RSS pubDate from a Javascript Date instance.
* @param Date - optional
* @return String
*/
function pubDate(date) {
if (typeof date === 'undefined') {
date = new Date();
}
@jochemstoel
jochemstoel / wf.txt
Created April 1, 2018 17:37 — forked from brookhong/wf.txt
Top 2000 Vocabulary Words
the 9243 (definite article,adverb)
of 5220 (preposition,auxiliary verb)
and 5196 (conjunction)
to 4951 (preposition,adverb)
a 4506 (indefinite article,noun,preposition)
in 2822 (preposition,adverb)
is 2699 (verb)
you 2041 (pronoun,noun)
are 1843 (verb)
for 1752 (preposition,conjunction)
@jochemstoel
jochemstoel / README.md
Created April 1, 2018 17:35 — forked from nitaku/README.md
Word cloud intersection

This experiment tries to define and show the concepts of intersection and difference between two word clouds.

Two distinct documents A and B (the first about infovis and datavis, and the other about Human-Computer Interaction) are each used to compute word frequencies. Each word in common between the two documents is then used to create the intersection set, in which each word is assigned the minimum value among its original weights (something reminiscent of a fuzzy intersection operation). The remaining words are used to create the difference sets. For each word in common, the set which had the greatest weight also retains that word with a weight subtracted of the intersection weight mentioned above. In pseudocode:

for each word in common between A and B
  let a_w be the weight of the word in A
  let b_w be the weight of the word in B
  put the word into the intersection set with weight = min(a_w, b_w)
  if a_w - min(a_w, b_w) > 0

put the word into the A \ B set with weigh

@jochemstoel
jochemstoel / Thinkful-scope-Answers
Created April 1, 2018 16:43 — forked from MPKel/Thinkful-scope-Answers
Scope questions/answers
What is scope?
Put simply, scope is the availability of a variable within a program.
Scope determines which parts of a program have the ability to access and manipulate a variable.
A global variable is available for access/manipulation by all parts and collective files(*sometimes) of a program.
A local variable's access is restricted to the function or block within which it was declared.
Why are global variables avoided?
Global variables are avoided because they create the possibility of unexpected side effects,
namely the unintended manipulation of variables, which causes functions to become indeterminate.
var dictionary = [
'the',
'of',
'and',
'to',
'a',
'in',
'for',
'is',
'on',
@jochemstoel
jochemstoel / main.js
Created February 1, 2018 16:34 — forked from xmalinov/main.js
electron-win-url
//chat://function/?param=bar
const { app, BrowserWindow } = require('electron');
const path = require('path');
const url = require('url');
let mainWindow = null;
let yourURL;
@jochemstoel
jochemstoel / statuses.json
Created January 30, 2018 19:37 — forked from AndersDJohnson/statuses.json
HTTP Status Codes from Node's http.STATUS_CODES
{
"100": "Continue",
"101": "Switching Protocols",
"102": "Processing",
"200": "OK",
"201": "Created",
"202": "Accepted",
"203": "Non-Authoritative Information",
"204": "No Content",
"205": "Reset Content",
@jochemstoel
jochemstoel / Documentation.md
Created December 29, 2017 08:44 — forked from Olical/Documentation.md
Preloader.js - Preload all assets, ideally for a game, using MooTools

About

This class allows you to preload all of your images, sounds, videos, JSON, JavaScript and CSS files with one call. It provides you with progress reports and lets you know when everything is done.

It requires MooTools and MooTools More with the Assets and Request.JSONP boxes ticked. I have attached a copy of the required MooTools More version to this gist.

Example

You can find an example here on jsFiddle.

@jochemstoel
jochemstoel / split_silence.sh
Created December 26, 2017 11:24 — forked from VojtechKlos/split_silence.sh
Guide to split audio recording by silence with SoX and ffmpeg
# First denoise audio
## Get noise sample
ffmpeg -i input.ogg -vn -ss 00:00:00 -t 00:00:01 noise-sample.wav
## Create noise profile
sox noise-sample.wav -n noiseprof noise.prof
## Clean audio from noise
sox input.ogg clean.wav noisered noise.prof 0.21
@jochemstoel
jochemstoel / transcribe.js
Created December 26, 2017 03:53 — forked from antiboredom/transcribe.js
Transcribe video/audio using IBM Watson
var request = require('request');
var fs = require('fs');
var sox = require('sox');
var spawn = require('child_process').spawn;
var WATSON_USER = '';
var WATSON_PASS = '';
var url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/recognize';