Skip to content

Instantly share code, notes, and snippets.

View mattbontrager's full-sized avatar

Matt Rose mattbontrager

View GitHub Profile
@mattbontrager
mattbontrager / titleCase.js
Last active August 22, 2017 22:55
Title Case a string; one for automating method calls, another for titles of articles, books, etc.
/**
* use this helper function to convert captured html element attributes
* (or whatever) to a title cased string.
*
* @date 2017-08-22
* @author mattbontrager
* @param {String} string [the string to be converted to CamelCase]
* @return {String} [the CamelCased string]
*/
function titleCaseWithSymbols(string) {
@mattbontrager
mattbontrager / .gitignore
Last active August 29, 2017 22:30
my gitignore, which is essentially a live document as there are always cool new things to find and add.
#text editors
*.esproj
*.sublime-workspace
*.tmlanguage.cache
*.tmLanguage.cache
*.tmPreferences.cache
*.stTheme.cache
# project files should be checked into the repository, unless a significant
# number of contributors will not be using SublimeText which
@mattbontrager
mattbontrager / Preferences.sublime-settings
Created August 29, 2017 22:55
My user settings for Sublime Text 3 text editor.
{
"always_show_minimap_viewport": false,
"auto_complete_triggers":
[
{
"characters": "<",
"selector": "text.html"
},
{
"characters": "bs3",
@mattbontrager
mattbontrager / .jscsrc
Last active August 29, 2017 23:05
my jscsrc template
{
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
@mattbontrager
mattbontrager / gist:3f366c327346cc35fa32e946c7cd8c90
Created August 30, 2017 18:36 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@mattbontrager
mattbontrager / checkObjectLength-helper.js
Last active October 6, 2017 20:24
Check the length of a JavaScript Object as though it were an Array.
function checkObjectLength(obj) {
var key = 0;
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
key++;
}
}
return key;
}
@mattbontrager
mattbontrager / jquery.ba-whenthen.js
Created October 18, 2017 20:14 — forked from cowboy/jquery.ba-whenthen.js
jQuery's "when" and "then" all rolled up together.
/*!
* jQuery whenthen - v0.2 - 3/12/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
@mattbontrager
mattbontrager / recursive-find-and-replace-on-mac.sh
Created January 29, 2018 22:15
Recursively find and replace a word or phrase from the command line on a Mac.
grep -rli 'old word or phrase' * | xargs -I@ sed -i '' 's/old word or phrase in regex/new word or phrase/g' @
var uk = createFuzzyScorer('United Kingdom');
var us = createFuzzyScorer('United States');
console.log([
uk('United') > uk('uk'),
uk('nited') > uk('ingdom'),
uk('united kingdom') > uk('united kingdo'),
uk('united dom') < uk('united kin'),
uk('knited k') > uk('dom'),
uk('_united_') < uk('united'),
@mattbontrager
mattbontrager / .gitmessage
Last active March 21, 2018 17:11
A custom git message template
## Git Commit Messages
# - Use the Present Tense ("Add feature" not "Added feature").
# - Use the Imperative Mood ("Move cursor to..." not "Moves cursor to...").
# - Limit the subject line to 50 characters
# - Wrap the body at 72 characters
# - Reference issues and pull requests
# - When only changing documentation, include `[ci skip]` in the commit description
# - Be creative with emojies