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
/* | |
============================= | |
# Mobile First @media queries | |
============================= | |
*/ | |
/* styles for iphone portrait go up here*/ | |
/* Smartphones (landscape) ----------- */ | |
@media only screen |
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
$(document).ready(function(){ | |
$( ".date" ).each(function( ) { | |
var month = $(this).text().substring(0,2); | |
var day = $(this).text().substring(7,9); | |
var year = $(this).text().substring(9,11); | |
if (month == 01) { | |
var month = 'Jan'; |
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
//simple version targetting a position: absolute div | |
$(window).on("scroll",function(){ | |
$('.target').css({"top" : ( .5 * $(window).scrollTop() ) + 100 }) | |
// the .5 refers to parallax speed (higher is faster) | |
// the 100 refers to the initial start position offset (higher is further down) | |
}) | |
// version with additional fading out as you scroll down |
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
// smooth scroll to a specific section on the same page | |
function smoothScroll (selector) { | |
$('html, body').animate( | |
{ | |
scrollTop: jQuery(selector).offset().top | |
}, | |
600, | |
'easeOutCubic', // curves from http://easings.net/ | |
function(){ | |
$('#company').focus(); |
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'); |
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
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
# 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
.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
function capitalizeFirstLetter(string) { | |
var firstLetter = string.substring(0, 1); | |
var newString = firstLetter.toUpperCase() + string.substring(1,string.length); | |
return newString; | |
} |
OlderNewer