Skip to content

Instantly share code, notes, and snippets.

View chriscorwin's full-sized avatar

Chris Corwin chriscorwin

View GitHub Profile
function throttle(fn, threshhold, scope) {
threshhold || (threshhold = 250);
var last,
deferTimer;
return function () {
var context = scope || this;
var now = +new Date,
args = arguments;
if (last && now < last + threshhold) {
define(
[
'jquery',
'text!templates/expressionbuilder.html',
'fueluxcomponentcore',
'expressionbuilder-i18n',
'underscore',
'moment',
'expressionbuilder-calendarlabels',
'dragula',
define(
[
'jquery',
'text!templates/expressionbuilder.html',
'fueluxcomponentcore',
'expressionbuilder-i18n',
'underscore',
'moment',
'expressionbuilder-calendarlabels',
'dragula',
@chriscorwin
chriscorwin / DOMObserver.js
Last active December 13, 2016 18:59
Watches the window for changes to the DOM of a given element, pushes the changes to some history vars for retrieval of "last" or by index. Very much WIP.
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
var list = document.querySelector('.expression');
var changeHistory = [];
var changeHistory2 = [];
var observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
if (mutation.type === 'childList') {
var list_values = [].slice.call(list.children)
.map(function (node) {
return node.innerHTML;

Could you elaborate on how this would be useful with you and your team?

Sure.

In long chats, or in comments with several replies, it can be helpful to quote text you are replying to, so that the context of what you are saying is not lost.

There can often be several conversations going on in a chat room or in a document's chat or comments, and quoting the text you are replying to helps everyone keep track of why you are saying what you are saying.

Are you afraid of losing a tentative comment?

ccorwin at ccorwin-ltm in ~/Library/Mobile Documents/com~apple~CloudDocs/Workspaces/design-system-react on GH-626---checkbox-needs-an-indeterminate-state-21 [$]
$ push
Would you like to push `GH-626---checkbox-needs-an-indeterminate-state-21` to origin? (y) n
Now pushing to: origin
------------------------------------------------------------------------------------
$ git push origin GH-626---checkbox-needs-an-indeterminate-state-21
ccorwin at ccorwin-ltm in ~/Library/Mobile Documents/com~apple~CloudDocs/Workspaces/design-system-react on GH-626---checkbox-needs-an-indeterminate-state-21 [$]
$ push
Would you like to push `GH-626---checkbox-needs-an-indeterminate-state-21` to origin? (y) n
Now pushing to: origin
------------------------------------------------------------------------------------
// Color variables (appears count calculates by raw css)
@color0: #0076de; // Appears 10 times
@color1: #e0e5ee; // Appears 7 times
@color2: #16325c; // Appears 5 times
@color3: #0070d2; // Appears 2 times
@color4: #990000; // Appears 2 times
// Width variables (appears count calculates by raw css)
@stepPseudoContentWidthFixed: 10px; // Appears 2 times
@stepBadgeWdith: 18px; // Appears 2 times
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;
# Make Tab autocomplete regardless of filename case
set completion-ignore-case on
# List all matches in case multiple possible completions are possible
set show-all-if-ambiguous on
# Immediately add a trailing slash when autocompleting symlinks to directories
set mark-symlinked-directories on
# Use the text that has already been typed as the prefix for searching through