Skip to content

Instantly share code, notes, and snippets.

@jwilson8767
jwilson8767 / es6-element-ready.js
Last active April 22, 2024 20:28
Wait for an element to exist. ES6, Promise, MutationObserver
// MIT Licensed
// Author: jwilson8767
/**
* Waits for an element satisfying selector to exist, then resolves promise with the element.
* Useful for resolving race conditions.
*
* @param selector
* @returns {Promise}
*/
@tracker1
tracker1 / normalize-to-string.js
Created February 9, 2017 01:11
prehash password
export default function normalizeToString(input) {
// string or String object
if (typeof input === 'string' || input instanceof String) return input.toString();
// boolean value
if (typeof input === 'boolean') return input.toString();
// numeric value
if (typeof input === 'number' || input instanceof Number) {
// not a finite value - invalid input - return empty
@btfak
btfak / useHexo.md
Created May 26, 2016 09:41
How to use Hexo and deploy to GitHub Pages
@miroslavpopovic
miroslavpopovic / Program.cs
Created December 1, 2015 14:29
Inject dictionary of interfaces with Ninject
using System;
using System.Collections.Generic;
using System.Linq;
using Ninject;
namespace ConsoleApplication5
{
public class Program
{
public static void Main(string[] args)
@danharper
danharper / background.js
Last active March 30, 2024 18:25
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@digitaljhelms
digitaljhelms / gist:4287848
Last active May 9, 2024 10:21
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch