Skip to content

Instantly share code, notes, and snippets.

View kentcdodds's full-sized avatar
馃
working hard to make the world better with software

Kent C. Dodds kentcdodds

馃
working hard to make the world better with software
View GitHub Profile
@kentcdodds
kentcdodds / README.md
Last active December 19, 2015 13:39
Social Media icons
@kentcdodds
kentcdodds / .bash_profile
Last active December 20, 2015 23:49
My Bash Profile
# Visual Customizations
function git_branch {
# Shows the current branch if in a git repository
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \(\1\)/';
}
# Default Prompt
PS1="\w\$(git_branch): ";
# PATH ALTERATIONS
^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
/* display: none; <- Crashes Chrome on hover */
-webkit-appearance: none;
-moz-appearance: none;
margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}
@kentcdodds
kentcdodds / C++.cpp
Last active December 21, 2015 05:29
InfiniteWPM default files
//Temp
@kentcdodds
kentcdodds / README.md
Last active May 11, 2019 22:45
AngularJS vs jQuery vs pure JavaScript

#Hello World Characters of Code Comparison

##JavaScript

Preview

Characters: 700

Lines of JavaScript: 13

@kentcdodds
kentcdodds / sort.m
Created October 23, 2013 22:35
Sorting Rook Cards. Because you need to do this all day long.
-(NSMutableArray *)sortCards:(NSMutableArray *)cards {
SEL selector = @selector(compareCard:);
NSArray *sortedArray = [cards sortedArrayUsingSelector:selector];
return [sortedArray mutableCopy];
}
function interval(func, wait, times) {
var interv = function(w, t) {
return function() {
if (typeof t === "undefined" || t-- > 0) {
setTimeout(interv, w);
try {
func.call(null);
} catch(e) {
t = 0;
throw e.toString();
@kentcdodds
kentcdodds / isInteger.js
Created January 4, 2014 20:50
AutoDoc test. Fails with: autodoc -t --verbose numbers.js TypeError: invalid data
(function (root, factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define(factory);
} else {
root.genie = factory();
}
}(this, function() {
@kentcdodds
kentcdodds / docsSearchInputSpec.js
Created January 24, 2014 19:44
Potential docsSearchInputSpec
describe('docsSearchInput', function() {
var FORWARD_SLASH_KEYCODE = 191;
var inputElement, body;
beforeEach(function() {
body = angular.element(document.body);
body.empty();
});