Skip to content

Instantly share code, notes, and snippets.

View stpettersens's full-sized avatar

Sam Saint-Pettersen stpettersens

View GitHub Profile
[package]
name = "ark_test"
version = "0.1.0"
authors = ["Sam Saint-Pettersen <[email protected]>"]
[dependencies]
ark = { git = "https://github.com/stpettersens/ark.git" }
@stpettersens
stpettersens / duolingo-autoplay-prompts.user.js
Last active August 20, 2018 23:11
User script to autoplay audio prompts on Duolingo.
// ==UserScript==
// @name Duolingo Autoplay audio
// @namespace 8442918f3dbd7268b7eabd74e1ce191e
// @version 0.1
// @description Autoplay the audio prompts on Duolingo.
// @author Sam Saint-Pettersen <[email protected]>
// @match https://www.duolingo.com/*
// @icon https://s32.postimg.org/8zxj3evit/duolingo.png
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==
@stpettersens
stpettersens / packager.sh
Created July 17, 2016 16:55
Packager demo
packager -p io.stpettersen.yggdrasill.client -m YggdrasillClient -cp libs -r Client
@stpettersens
stpettersens / coolifier.js
Last active July 4, 2016 07:10
Coolifier example in JS (function which returns a function) [@vakila]
/*
Adapted from Anjana Vakil's (@vakila) Learning Functional Programming with JavaScript presentation @ JSUnconf 2016
https://youtu.be/e-5obm1G_FY?t=9m24s
*/
'use strict'
function makeAdjectifier (adjective) {
return function (string) {
return adjective + ' ' + string
@stpettersens
stpettersens / chrome_extensions.md
Last active August 15, 2016 22:35
Good Chrome/Vivaldi extensions and user scripts.

Chrome/Vivaldi extensions:

  • IP Whois & Flags Chrome & Websites Rating
  • Google Mail Checker
  • Send from Gmail (by Google)
  • Mailto: for Gmail™
  • Google Input Tools
  • PrettyPrint
  • XML Tree
  • JSONView
@stpettersens
stpettersens / atom_packages.md
Last active July 6, 2016 09:18
Packages to install on Atom.

Packages to install on Atom:

  • atom-jade
  • atom-handlebars
  • atom-typescript
  • language-typescript-grammars-only
  • language-rust
  • language-docker
  • language-ignore
  • color-picker
@stpettersens
stpettersens / startt.cmd
Created March 27, 2016 13:13
Start new window process wrappers
start %*
@stpettersens
stpettersens / ogg-server.js
Created March 20, 2016 18:28
Server which listens for PCM stream and outputs a Ogg Vorbis file (doesn't work yet).
'use strict';
const ogg = require('ogg');
const vorbis = require('vorbis');
const BinaryServer = require('binaryjs').BinaryServer;
let server = BinaryServer({port: 8080});
let oe = new ogg.Encoder();
let ve = new vorbis.Encoder();
let out = null;
@stpettersens
stpettersens / wav-server.js
Created March 20, 2016 18:25
Server which listens for PCM stream and outputs a WAVE file.
'use strict';
const wav = require('wav');
const BinaryServer = require('binaryjs').BinaryServer;
let server = BinaryServer({port: 8080});
let out = null;
server.on('connection', function(client) {
client.on('stream', function(stream, meta) {
@stpettersens
stpettersens / wrap.js
Created January 24, 2016 15:49
Wrap function (@mdjasper).
/*
Michael Jasper's (@mdjasper) wrap DOM element function.
From: http://www.mikedoesweb.com/2014/wrapping-an-element-in-vanilla-javascript/
*/
function wrap(top, selector, bottom){
var matches = document.querySelectorAll(selector);
for (var i = 0; i < matches.length; i++){
var modified = top + matches[i].outerHTML + bottom;
matches[i].outerHTML = modified;
}