Skip to content

Instantly share code, notes, and snippets.

View chriscorwin's full-sized avatar

Chris Corwin chriscorwin

View GitHub Profile
@bitmvr
bitmvr / dtmf--mary-had-a-little-lamb.js
Last active April 3, 2024 20:16
Mary Had A Little Lamb - DTMF
// 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
var short = 250;
var long = short * 2;
function sleep(ms) {
@robinsloan
robinsloan / shh.rb
Last active August 18, 2023 12:09
Disable RTs from all the people you follow on Twitter.
require "rubygems"
require "twitter"
# get these from apps.twitter.com
CONSUMER_KEY = "foo"
CONSUMER_SECRET = "bar"
OAUTH_TOKEN = "blee"
OAUTH_TOKEN_SECRET = "baz"
TWITTER_USER = "your_username" # needs to be the one associated with keys above
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;
@markerikson
markerikson / react-controlled-inputs.md
Last active June 15, 2021 12:50
React "controlled" vs "uncontrolled" inputs explanation

[12:03 AM] acemarke: "controlled" and "uncontrolled" inputs
[12:04 AM] acemarke: if I have a plain, normal HTML page, and I put <input id="myTextbox" type="text" /> in my page(edited)
[12:04 AM] acemarke: and I start typing into that textbox
[12:04 AM] acemarke: it remembers what I've typed. The browser stores the current value for that input
[12:05 AM] acemarke: and then sometime later, I can get the actual element, say, const input = document.getElementById("myTextbox"), and I can ask it for its value: const currentText = input.value;
[12:05 AM] acemarke: good so far?
[12:08 AM] acemarke: I'll keep going, and let me know if you have questions
[12:08 AM] lozio: ok, actually I'm reading
[12:09 AM] lozio: good
[12:09 AM] acemarke: so, a normal HTML input field effectively stores its own value at all times, and you can get the element and ask for its value

@cmcculloh-kr
cmcculloh-kr / expanded
Created April 27, 2016 16:25
Get branch from JIRA
// This is the expanded code for the bookmarklet.
// Use the minified code for the actual bookmarklet
javascript:(function() {
var title = jQuery('title').text();
var ticket = title.match(/\[(.*)]/);
var title_no_ticket = title.replace(/\[.*]\ /, '');
var title_no_suffix = title_no_ticket.replace(/\ \-\ ExactTarget\ JIRA/, '');
var title_cleaned = title_no_suffix.replace(/ \& /g, '_and_');
title_cleaned = title_cleaned.replace(/\&/g, '/');
@cmcculloh
cmcculloh / linkbait.md
Last active October 2, 2015 16:29
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 this comic, Clickbait Headline Generator and this article used as a reference.

  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, the 4th will leave you speachless."
  2. Case Studies
    Perfect for unit test commit comments (you can even use the GH Issue number as the case study number)
    • "Case Study #1543: Does spinbox still allow exceeding maximum through manual input?"
    • `"Case Study #24: Does repeater still

Your Vision

What is a vision?

Your vision answers the question "What do I want?" A clear vision help you communicate why you're here and what impact you're going to have.

Your vision should be aligned with the company vision, with your manager's V2MOM, and it should be personal. It should be an honest reflection of your own vision for your own work.

If you manage a team, it should be reflective of the purpose of the team and your collective impact.

@bnoguchi
bnoguchi / enum-access.js
Created May 3, 2011 09:19
How to access enumValues in mongoose from a Model or Document
var mongoose = require('./index')
, TempSchema = new mongoose.Schema({
salutation: {type: String, enum: ['Mr.', 'Mrs.', 'Ms.']}
});
var Temp = mongoose.model('Temp', TempSchema);
console.log(Temp.schema.path('salutation').enumValues);
var temp = new Temp();
console.log(temp.schema.path('salutation').enumValues);