Skip to content

Instantly share code, notes, and snippets.

View betaorbust's full-sized avatar
👶
Code comes second.

Jacques Favreau betaorbust

👶
Code comes second.
View GitHub Profile
@betaorbust
betaorbust / console_manager.js
Created September 28, 2014 21:28
Console output manager
/**
* @author Jacques Favreau (@betaorbust)
* @fileOverview Console manager.
* The utility will silence all console output (info, log, error) unless a dev cookie is set.
* Does the cookie/silence check on load, and also via the exported methods for turning it on/off
* after pageload.
* Exports a global consoleManager object with the following methods:
* silence(): Shuts the console up.
* restore(): Gets the console all chatty.
* toggle(): toggle the dev cookie state and does an appropriate silence or restore.
@betaorbust
betaorbust / three_level_bar_icon.less
Last active August 29, 2015 14:07
Three level bar icon using one HTML element.
// Three-Level Bar Icon
// ====================
// Makes a three-bar icon for showing difficulty, signal, etc. from a single HTML element.
//
// #
// # #
// # # #
//
// Actual Image: ![Three-level bar icon](goo.gl/RnCPUQ)
//
@betaorbust
betaorbust / README.md
Last active July 21, 2018 19:57
ES2015 fallback check for Progressive Transpilation

ES2015 Syntax Check for use with Progressive Transpilation

The attached file file spits out a string for direct injection into the head of a page, which will be a lightweight test of the ability to parse and run ES2015 syntax.

Unminified version

This is the original source for the test-case below:

class ಠ_ಠ extends Array{
@betaorbust
betaorbust / Senicide.js
Created March 22, 2018 23:46
Delete largest old Slack files
/**
* Deletes the largest `numToDelete` files older than `minAgeDays` on your slack.
* Can only do 1000 at a time because I didn't want to deal with pagination.
* YOU NEED TO BE AN ADMIN FOR THIS TO DELETE THINGS THAT YOU DIDN'T UPLOAD!
* @param {string} token A legacy slack token. Get yours at https://api.slack.com/custom-integrations/legacy-tokens
* @param {number} minAgeDays The number of days old a file can be to be deleted.
* @param {number} numToDelete The number of files to delete total.
*/
async function deleteOldLargeFiles(token, minAgeDays, numToDelete) {
// Slack does everything in seconds, apparently.
@betaorbust
betaorbust / README.md
Last active December 17, 2018 21:48
List or delete local squash-merged git branches. Cleans up that Github mess!

Delete Squash-merged local Git Branches

Shock at "git branches"

This project has been moved into github-loppers.