This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html | |
font-size: 62.5% | |
body | |
font-size: 1.6rem // = 16px |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isValidEmail(input) { | |
var trimmedInput = $.trim(input), | |
hasSpaces = trimmedInput.indexOf(' ') !== -1, // true if no spaces | |
matchesBasicEmailPattern = trimmedInput.match(/@.*[.]/); | |
return matchesBasicEmailPattern && !hasSpaces; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from http://makandracards.com/makandra/18605-you-don-t-need-each-collect-or-select-in-coffeescript | |
## each | |
for item in items | |
... | |
## collect / map | |
ages = (person.age for person in people) | |
## select / grep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ripped off from ea1.co */ | |
/* (just add vendor prefixes) */ | |
body { | |
animation: background-animation-cool 5s linear infinite alternate; | |
} | |
section:nth-child(2n+1) { | |
animation: background-animation-warm 5s linear infinite alternate; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function capitalizeFirstLetter(string) { | |
var firstLetter = string.substring(0, 1); | |
var newString = firstLetter.toUpperCase() + string.substring(1,string.length); | |
return newString; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.border-box() { | |
box-sizing: border-box; | |
-moz-box-sizing: border-box; | |
} | |
.box-shadow(@style) { | |
-webkit-box-shadow: @style; | |
-moz-box-shadow: @style; | |
box-shadow: @style; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add me to .bash_profile or .bashrc | |
alias git-recent="git for-each-ref --count=5 --sort=-committerdate refs/heads/ --format='🌺 %(refname:short)'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func getJSON(urlToRequest: String) -> NSData{ | |
return NSData(contentsOfURL: NSURL(string: urlToRequest)) | |
} | |
func parseJSON(inputData: NSData) -> NSDictionary{ | |
var error: NSError? | |
var boardsDictionary: NSDictionary = NSJSONSerialization.JSONObjectWithData(inputData, options: NSJSONReadingOptions.MutableContainers, error: &error) as NSDictionary | |
return boardsDictionary | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.transition(@time) { | |
-webkit-transition: all @time; | |
-moz-transition: all @time; | |
-o-transition: all @time; | |
transition: all @time; | |
} | |
.line-height(@px) { | |
line-height: @px; | |
@rem: unit(@px, rem); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sequentialAnimation(first, second, triggerClass) { | |
first.one('webkitAnimationEnd oanimationend msAnimationEnd animationend', function() { | |
second.addClass(triggerClass); | |
}); | |
} | |
// sample usage | |
sequentialAnimation($('.first-element-with-animation'), $('.element-to-animate-after'), 'classname-which-triggers-animation-on-the-second-element'); |