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
/** | |
A little bare-bones drake calculator whipped together in ten minutes just to test some values and have fun. | |
Should work in all modern browsers. | |
**/ | |
function createDrake(element){ | |
if(!element){element = document.body;} | |
const container = document.createElement('div'); | |
container.id = 'drake'; |
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
<!-- Outlook Pagination --> | |
<tr> | |
<td class="nvft"> | |
<table cellspacing="0" cellpadding="0" class="hdvt"> | |
<tbody> | |
<tr> | |
<td class="ihdv"> | |
<img src="https://r1.res.office365.com/owa/15.1.477.5/themes/basic/clear.gif" alt=""> | |
</td> | |
</tr> |
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
//this leaves whitespace where the thumbnail was. | |
[].forEach.call(document.querySelectorAll('.watched-badge'),function(el){el.parentNode.parentNode.parentNode.parentNode.style='display:none'}) |
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
/** | |
// Super simple version of the below; if you just want to look up deep values, that's all you need: | |
function lookup_simple(obj,path,delimiter='.'){ | |
if(obj==null || !path || !path.length){return obj;} | |
path = Array.isArray(path) ? path : path.split(delimiter); | |
const rest = path.slice(1); | |
const current = obj[path[0]]; | |
return (rest.length ? lookup_simple(current,rest) : current) | |
} | |
// ...And that's all that's needed for the simple lookup. For a more advanced version, read on |
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
export const by_numbers = { | |
8:"backspace" | |
, 9:"tab" | |
, 13:"enter" | |
, 16:"shift" | |
, 17:"ctrl" | |
, 18:"alt" | |
, 19:"pause/break" | |
, 20:"caps lock" | |
, 27:"escape" |
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
#!/usr/bin/env bash | |
# Depends on: | |
# - notify-send | |
# - paplay | |
# base stolen from: http://snipplr.com/view/39697/a-simple-timer-to-apply-the-pomodoro-technique/ | |
# | |
scriptname=$(basename $0 .sh) | |
scriptvers='0.1' |
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
// accurate time resolution | |
// stolen from https://github.com/myrne/performance-now | |
const now = (function(){ | |
if((typeof performance !== "undefined" && performance !== null) && performance.now) { | |
return function nowPerformance() { | |
return performance.now(); | |
}; | |
} | |
if ((typeof process !== "undefined" && process !== null) && process.hrtime) { | |
let hrtime = process.hrtime; |
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
/** | |
* Creates or updates a group and attached files and sub-groups | |
* @param {Object} rethink object with {r,conn} | |
* @param {Object|String} mainGroup either a group name, or an object {id,name} | |
* @param {Array} files an array of files paths or an array of {id,path} | |
* @param {Array} groups an array of groups names or an array of {id,name} | |
* @param {Function} callback a nodeback with signature (err,results) | |
* | |
* This function creates or updates a group on the fly | |
* Examples: |
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
class TreeNode extends Component{ | |
render(){ | |
return (<table> | |
{this.props.files.map(function r(child){ | |
return [<tr>{child.name}</tr>] | |
.concat(child.files.map(r)) | |
})} | |
</table>) | |
} | |
} |
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
function renderNodes({name,directories,files}){ | |
return [<tr>{name}</tr>] | |
.concat(directories.map(renderNodes)) | |
.concat(files.map(file=><tr>{file}</tr>)) | |
} | |
class Root extends Component{ | |
render(){ | |
return (<table> | |
<thead>{this.props.name}</thead> |