Skip to content

Instantly share code, notes, and snippets.

@ICEDLEE337
ICEDLEE337 / .jshintrc
Created February 1, 2016 23:22
.jshintrc to expose console.log statements
{
"bitwise": false,
"curly": true,
"eqeqeq": true,
"es3": false,
"forin": true,
"freeze": true,
"immed": true,
"indent": 4,
"latedef": true,
javascript: (() => {
var $http = $('body').injector().get('$http');
var url = 'proxy/authpermissions-v2-server/toggles/';
const GREEN = 'green';
const RED = 'black';
function render() {
const scrollPos = window.scrollY;
$http.get(url).then(res => res.data.toggles.sort((a, b) => sorter(a, b))).then(toggles => {
const ul = convertTogglesToUl(toggles);
url = 'https://gist.githubusercontent.com/ICEDLEE337/5db30bd28cc8ea2aefa974c5ef4b4400/raw/bba284eab353ab9a7ba5c58554db02730cada218/togglii.js';
fetch(url)
.then(r => r.text())
.then(inject);
function inject (text) {
var script = Object.assign(document.createElement('script'), {innerText: text});
document.body.appendChild(script);
}
@ICEDLEE337
ICEDLEE337 / gitflow-breakdown.md
Created April 5, 2019 15:14 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@ICEDLEE337
ICEDLEE337 / lodash-throttle.js
Created November 16, 2017 03:25
example of using lodash's `throttle`
(() => {
// in this example we invoke a fn for a period of 10 sec, invoking it 10 times a second, but we can perceive that the original function is only invoked at most once per second according to the parameter below
var TOTAL_TIME_TO_RUN = 10000; // 10 sec
var THROTTLE_INTERVAL = 2000; // <= adjust this number to see throttling in action
var INVOCATION_INTERVAL = 100; // 0.1 sec
// regular fn
var punchClock = function punchClock () {