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
/** | |
* Ossilate - Make things go back and forth! | |
* TODO: Easings | |
* @param {Number} amplitude The distance from the center of motion to either extreme. | |
* @param {Number} interval The amount of time it takes for one complete cycle of motion in frames. | |
* @param {Number} time The current frame count, ideally a deltaTime value. | |
* @param {String} trigonometricFunction The function to be used to calculate the value. Defaults to 'sin'. | |
*/ | |
oscillate = (amplitude, interval, time, trigonometricFunction = 'sin') => { | |
return amplitude * Math[trigonometricFunction]((Math.PI * 2.0) * time / interval); |
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
// Task: Write a function that recursively loops through a multidimensional array and counts the instances of an item | |
// Le data | |
var arr = [ | |
'apples', | |
['apples', 'oranges,', 'bananas', ['apples',]] | |
]; | |
// A quick and dirty nested loop. | |
// Will only work if nesting is one level deep |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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.observe("dom:loaded", function() { | |
console.log('DOM loaded'); | |
// $$('td').invoke('observe', 'click', setColor); | |
}); | |
var smile = { | |
0:[0,0,0,0,0,0,0,0,0,0,0,0,0], // Dont use this row | |
1:[0,0,0,1,1,1,1,1,0,0,0,0,0], | |
2:[0,0,1,0,0,0,0,0,1,0,0,0,0], |
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
$regex = '/(?<date_format_1>(?<day>(?i)\b\s*[0-9]+(?:st|nd|rd|th|)?) | |
(?<month>(?i)(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sept(?:ember?)|Oct(?:ober)?|Nov(?:ember?)|Dec(?:ember)?)) | |
(?<year>\b\s*20[0-9]{2}))| | |
(?<date_format_2>(?P>month)(?P>day)(?!\s+-)(?:\s&\s(?P>day))?) | | |
(?<range_type_1>(?P>month)(?P>day)\s+-\s+(?P>day)) | |
/x'; |
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
// Shadows | |
.shadow-1 { | |
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); | |
transition: all 0.3s cubic-bezier(.25,.8,.25,1); | |
} | |
.shadow-2 { | |
box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); | |
transition: all 0.3s cubic-bezier(.25,.8,.25,1); |
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
.v-align-wrapper { | |
position: absolute; | |
left: 0; | |
bottom: 0; | |
top: 0; | |
width: 100%; | |
height: 100%; | |
display: table; | |
margin: 0 auto; | |
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
.shy-header { | |
position: fixed; | |
top: 0; | |
width: 100%; | |
left: 0; | |
height: 91px; | |
z-index:9999; | |
} |
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() { | |
// Delcare Vars | |
var email = $('input#email'); | |
var emailWrap = $('.email-wrap'); | |
var emailWrapperAlert = email.parent('.input-wrap > div.alert'); | |
var alertBox = true; | |
var emailVal = $('input#email').val() | |
$('#ideas-submit-button').click(function(event){ | |
// Stop the button default |
NewerOlder