Skip to content

Instantly share code, notes, and snippets.

Daniel Sellers designfrontier

Block or report user

Report or block designfrontier

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View update-vault
#!/usr/bin/env bash
string="{\"$2\": \"$3\"}"
mount=$1
vault write $mount @<(vault read -format json $mount | jq ".data + $string")
@designfrontier
designfrontier / slackme
Last active Dec 3, 2018
Pipe to Slack
View slackme
#!/usr/bin/env node
const http = require('https');
const url = process.env.SLACK_URL;
let data;
process.stdin.resume();
process.stdin.setEncoding('utf8');
@designfrontier
designfrontier / subl-patch
Created Mar 14, 2018
opens all of the files that have changed between where you are in git and HEAD on master in sublime. Handy
View subl-patch
#!/usr/bin/env node
const cp = require('child_process');
cp.exec('git diff --name-only master HEAD', (err, out) => {
const files = [].concat('subl', '.', out.split('\n')).join(' ');
cp.exec(files, (e, o) => {
if (e) {
console.log(e, 0);
process.exit(1);
@designfrontier
designfrontier / foresight.sh
Last active Jan 31, 2017
foresight: A way to find major owners of files you have changed in your commit
View foresight.sh
#!/usr/bin/env bash
set -e
function ADD_AUTHOR {
local author_to_add=$1
if ! [ -z "${author_to_add}" ]; then
#add something to add people to review in your source repo
fi
View absorb.js
// abs.js
const FILES = require('fs');
module.exports = {
absorb: (htmlPath) => {
let html = FILES.readFileSync(htmlPath, 'utf8');
html = html.replace(/(<absorb\s(.+)\/>)/g, function(absorbElement) {
let filePath = '', fileType = '', jsMod = '';
if (absorbElement.indexOf('css=') >= 0) {
View web.io
writeln("setting up server...")
server := HttpServer clone do(
setPort(8090)
renderResponse := method(request, response,
list("path", "uri", "body") foreach(k,
v := request perform(k)
response body appendSeq(k .. ": " .. v .. "<br>")
)
View ajaxQueue.js
const ajax = require('utils/ajax');
const Promise = require('Promise');
/*
* The queue itself...
*
* @param {String} retryConut The number of times that it should retry a request
* before it gives up and rejects it.
*
* @return {object}
@designfrontier
designfrontier / queue.js
Last active May 12, 2016
pseudo-ish code change queue
View queue.js
const saveQueue = [
slide,
slide1,
slide2,
slide
];
const attemptedSlides = {};
const running = false;
@designfrontier
designfrontier / getCurrentBG.js
Last active Jan 12, 2016
get Background color
View getCurrentBG.js
getComputedBG = function (elem) {
var rtn = window.getComputedStyle(elem)['background-color'],
element = elem,
isTransparent = function (color) {
return color === 'rgba(0, 0, 0, 0)' || color === 'transparent'
};
while (element !== null && isClear(rtn)) {
element = element.parentElement;
rtn = window.getComputedStyle(element)['background-color'];
@designfrontier
designfrontier / app.js
Created Dec 1, 2015
return a 500 error for all requests
View app.js
var http = require('http');
var server = http.createServer(function (req, res) {
console.log(req.url);
if (req.url !== '/api/presence' && req.url !== '/api/heartbeat') {
res.statusCode = 500;
res.end('error');
} else {
res.end('works');
}
You can’t perform that action at this time.