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
export default class BaseElement extends HTMLElement { | |
constructor() { | |
super(); | |
this.attachShadow({mode: 'open'}); | |
} | |
connectedCallback() { | |
this.setupTemplate(); | |
this.render() | |
} |
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
// ==UserScript== | |
// @name Random Twitter Redirect | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Go do something nice instead | |
// @author Me | |
// @match https://twitter.com/* | |
// @grant none | |
// ==/UserScript== |
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
trap 'exit 130' INT | |
soundfile=$1 | |
if [ ! -f "${soundfile}" ]; then | |
echo "Pass sound file as first parameter" | |
exit | |
fi |
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 bash | |
# | |
# Author: postmodern | |
# This fork: bobbigmac | |
# Description: | |
# Rips a DVD to one H.264 MKV file for each title. | |
# Ignores any bad blocks or sectors on the DVD. | |
# Unlike original, does not write tags | |
# Dependencies: | |
# * gddrescue |
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
const args = process.argv || []; | |
const fs = require('fs'); | |
const vm = require('vm'); | |
// Execute as | |
// node perf-test.js test.js | |
const filename = args[2]; | |
const runs = 100; |
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
// ==UserScript== | |
// @name Delete facebook posts | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.facebook.com/bobdavies | |
// @icon https://www.google.com/s2/favicons?domain=facebook.com | |
// @grant none | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name Delete your tweets by search | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://twitter.com/search?q=* | |
// @grant none | |
// ==/UserScript== |
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
let sharedContext = false; | |
const getContext = (context) => { | |
if(!sharedContext) { | |
sharedContext = context || document.createElement("canvas").getContext("2d");; | |
} | |
return sharedContext; | |
} |
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 whenSelectorReady(selector, func) { | |
window.setTimeout(function() { | |
var titleEl = document.querySelector(selector); | |
if(titleEl) { | |
func(false, titleEl); | |
} else { | |
whenSelectorReady(selector, func); | |
} | |
}, 300); |
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
// Simple proxy-based observable | |
// Supports myObject.on('set', 'mykey', doMyFunc) | |
class ObservableObject extends Object { | |
ensure(type) { | |
this.events = this.events || {}; | |
this.events[type] = this.events[type] || []; | |
} | |
on(type, key, handler) { | |
this.ensure(type); |
NewerOlder