Skip to content

Instantly share code, notes, and snippets.

View chriscorwin's full-sized avatar

Chris Corwin chriscorwin

View GitHub Profile
// Navigate to http://onlinetonegenerator.com/dtmf.html
// Open DevTools - Console
// Paste the Code
// Press Enter
// Provide the number of milliseconds the default tone should hold for
let short = 250;
let long = short * 2;
function sleep(ms) {
@chriscorwin
chriscorwin / font_face.sublime-settings
Created March 23, 2017 15:23 — forked from rex/font_face.sublime-settings
Sublime Text 'font_face' configuration values
{
// "font_face": "Anonymous Pro",
// "font_face": "Anonymous Pro Bold",
// "font_face": "Anonymous Pro Minus",
// "font_face": "Anonymous Pro Minus Bold",
// "font_face": "Andale Mono",
// "font_face": "AverageMono",
// "font_face": "AverageMono Bold",
// "font_face": "Consola Mono",
// "font_face": "Consola Mono Bold",
javascript: (function() {
let repoName;
if (document.querySelectorAll('.public .author').length !== 0) {
repoName = document.querySelectorAll('.public .author')[0].textContent;
} else if (document.querySelectorAll('.private .author').length !== 0) {
repoName = document.querySelectorAll('.private .author')[0].textContent;
}
let repoAuthor = document.querySelectorAll('.gh-header-meta .author')[0].textContent;
let issueNumber = document.querySelectorAll('.gh-header-number')[0].textContent;
@chriscorwin
chriscorwin / node-util.sublime-snippet
Last active March 16, 2016 18:11 — forked from interactivellama/node-util.sublime-snippet
Snippet for NodeJS's util library that inspects all levels of a variable
<snippet>
<!-- Snippet for https://nodejs.org/api/util.html -->
<!-- Put this file in `Sublime Text 3/packages/User/ then restart. -->
<!-- Don't forget to import `const util = require('util');` -->
<content><![CDATA[
console.log(`[ $TM_FILEPATH:$TM_LINE_NUMBER ] ${1:$SELECTION}: `, util.inspect(${2:$SELECTION}, { showHidden: true, depth: null, colors: true }));$0
]]></content>
<tabTrigger>util</tabTrigger>
<scope>text.html,source.js</scope>
<description>console.log(util.inspect())</description>
@chriscorwin
chriscorwin / linkbait.md
Created October 2, 2015 15:59 — forked from cmcculloh/linkbait.md
Top 28 strategies for perfect link bait git commit comments, first you'll be skeptical, then you'll be inspired.

Writing git commit comments is boring. Following this guide will make it easy to make it much more fun. Inspired by XKCD.

Remember to use words like "tries", "weird", "shock", "surprising", "facts", "secretly", "really", "forced", "won't believe", "what happens next", "knows", "actually lies", "the reason why will make you cry", "first you'll be [shocked|dismayed|adjective], then you'll be [inspired|enraged|adjective]"

  1. The List Good for fixes that required a number of discrete methods to fix something
    • "10 antipaterns everyone knows are actually just lies"
    • "5 weird ways spinbox changed in just 2 weeks"
  2. Case Studies Perfect for unit test commit comments (you can even use the GH Issue number as the case study number)
// ==UserScript==
// @name Headphones
// @namespace http://chomperstomp.com
// @version 0.1.3.7.56
// @description Cut out the useless Chatter
// @author Christopher McCulloh
// @match https://org62.my.salesforce.com/*
// @grant none
// @require https://code.jquery.com/jquery-latest.js
// @require https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js
/**
* Turns someCrazyName into Some Crazy Name
* Decent job of acroynyms:
* ABCAcryonym => ABC Acryoynm
* xmlHTTPRequest => Xml HTTP Request
*/
String.prototype.unCamelCase = function(){
return this
// insert a space between lower & upper
.replace(/([a-z])([A-Z])/g, '$1 $2')