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
#box { | |
width: 200px; | |
height: 200px; | |
padding: 10px; | |
margin: 5px; | |
border: 1px solid black; | |
} |
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
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
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
alert("test"); |
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
// The previous code could be rewritten as the following | |
$( ".widget" ).css( "color", "green" ); |
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 deferredRequest( resource, data ) { | |
return $.Deferred(function( dfd ) { | |
amplify.request({ | |
resourceId: resource, | |
data: data, | |
success: dfd.resolve, | |
error: dfd.reject | |
}); | |
}).promise(); | |
} |
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
/* Nothing here */ |
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
( ( logger, $ ) -> | |
logContainer = null | |
write = ( msg ) -> logContainer.append "<p>#{ msg }</p>" | |
logger.init = ( el ) -> logContainer = el | |
logger.log = ( msg ) -> write msg | |
) window.logger = window.logger || {}, jQuery |
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
// Sold on jQuery - just re-wrote the following Prototype code: | |
Element.observe(window, 'load', function(){ | |
// This is for slow forms (like the signup one), | |
// so the user doesn't click 'Submit' twice. | |
$$('form.slow').each(function(frm){ | |
var sub = frm.down("input[type='submit']"); | |
if(sub) sub.disabled = ''; | |
$(frm).observe('submit', function(e){ | |
var sub = frm.down("input[type='submit']"); |