This is now an actual repo:
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
import axios from 'axios' | |
let mockingEnabled = false | |
const mocks = {} | |
export function addMock(url, data) { | |
mocks[url] = data | |
} |
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
#!/bin/bash | |
# Might as well ask for password up-front, right? | |
sudo -v | |
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing. | |
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & | |
# Example: do stuff over the next 30+ mins that requires sudo here or there. | |
function wait() { |
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
var stringify = function(obj, prop) { | |
var placeholder = '____PLACEHOLDER____'; | |
var fns = []; | |
var json = JSON.stringify(obj, function(key, value) { | |
if (typeof value === 'function') { | |
fns.push(value); | |
return placeholder; | |
} | |
return value; | |
}, 2); |
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
var isPrimitive = function(val) { | |
return val !== function() { return this; }.call(val); | |
}; |
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
:<<"::CMDLITERAL" | |
@echo off | |
FOR /F "tokens=* USEBACKQ" %%F IN (`wsl wslpath '%~f0'`) DO ( | |
SET script_path=%%F | |
) | |
bash -c "'%script_path%'" | |
exit /b | |
::CMDLITERAL | |
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) |
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
// Re. https://github.com/umdjs/umd/blob/master/returnExportsGlobal.js | |
// ================================================== | |
// Q. Does all that UMD stuff need to be at the top? | |
// ================================================== | |
(function (root, factory) { | |
if (typeof exports === 'object') { | |
// Node. Does not work with strict CommonJS, but | |
// only CommonJS-like enviroments that support module.exports, |
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
// To give your project a unique name, this code must be | |
// placed into a .c file (its own tab). It can not be in | |
// a .cpp file or your main sketch (the .ino file). | |
#include "usb_names.h" | |
// Edit these lines to create your own name. The length must | |
// match the number of characters in your custom name. | |
#define MIDI_NAME {'S','y','n','c','a','t','r','o','n'} |
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
<?php | |
// Use in the "Post-Receive URLs" section of your GitHub repo. | |
if ( $_POST['payload'] ) { | |
shell_exec( 'cd /srv/www/git-repo/ && git reset --hard HEAD && git pull' ); | |
} | |
?>hi |
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
javascript:(function()%7B%5B...document.querySelectorAll('.usertext-body%20*')%5D.forEach(p%20%3D%3E%5B...p.childNodes%5D.filter(n%20%3D%3E%20n.nodeType%20%3D%3D%3D%203).forEach(n%20%3D%3E%20%7Bconst%20re%20%3D%20%2F%5CS%7B16%2C%7D%2Fg%3Bif%20(re.test(n.nodeValue))%20%7Btry%20%7Blet%20isHtml%2C%20child%3Bconst%20s%20%3D%20n.nodeValue.replace(re%2C%20s%20%3D%3E%20%7Bs%20%3D%20atob(s)%3Bif%20(%2F%5Ehttps%3F%3A%5C%2F%5C%2F%2F.test(s))%20%7Bs%20%3D%20%60%3Ca%20href%3D%22%24%7Bs%7D%22%20target%3D_blank%3E%24%7Bs%7D%3C%2Fa%3E%60%3BisHtml%20%3D%20true%3B%7Dreturn%20s%3B%7D)%3Bif%20(isHtml)%20%7Bconst%20tmp%20%3D%20document.createElement('div')%3Btmp.innerHTML%20%3D%20s%3Bchild%20%3D%20document.createDocumentFragment()%3B%5B...tmp.childNodes%5D.forEach(c%20%3D%3E%20child.append(c))%3B%7D%20else%20%7Bchild%20%3D%20document.createTextNode(s)%3B%7Dp.replaceChild(child%2C%20n)%3B%7D%20catch%20(e)%20%7B%7D%7D%7D))%7D)() |
NewerOlder