This Gist was automatically created by Carbide, a free online programming environment.
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
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats | |
# Change http://example.com (at the end of the last RewriteRule) to your website url | |
<IfModule mod_headers.c> | |
#RequestHeader set X-Prerender-Token "YOUR_TOKEN" | |
</IfModule> | |
<IfModule mod_rewrite.c> | |
RewriteEngine On |
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
// Write a function that returns its argument. | |
// Write a function that takes a name and returns the length of the name. | |
// Write a function that takes two numbers, adds them, and returns the result. | |
// Write a function that takes an object and adds the key:value pair of "France" : "Paris" to it. Return the object. |
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
// Defintions | |
// Numbers | |
// 4, 5, 28, 1003, 42, 3.423 | |
var meaningoflife = 42; | |
console.log(meaningoflife); // 42 - no quotations, no brackets, no squigglies, no nuthin' | |
// math operations |
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
$( '.carousel' ).cycle({ | |
fx: 'carousel', | |
timeout: 0 | |
}); | |
$('.next').on('click', function() { | |
nextSlide(); | |
}); |
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 carousels(element, jump) { | |
var carousel; | |
carousel = $(element).cycle({ | |
fx: 'carousel', | |
timeout: 0, | |
allowWrap: false | |
}); | |
var totalSlides = $(element).data('cycle.opts').slideCount; |
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
FLEXY.JS | |
A stab at writing a horizontal-filling grid-system (as opposed to jQuery Masonry’s vertical fill) and a chance to explore some base-level usage of the lodash library. | |
GA-ANALYTICS.JS | |
My first foray into writing event tracking for Google Analytics. This snippet can be dropped into any website and will automatically setup video analytics for YouTube videos. I have a partner script that does the same for HTML5 vidoes (seen here). | |
PROJECT FAST | |
A MEAN app (though possibly under going a rewrite in React) that will become a character creator/manager for a table-top RPG developed by Bret Stevens. |
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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
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
//general | |
var gulp = require('gulp'); | |
var del = require('del'); | |
var copy = require('gulp-copy'); | |
//sass | |
var sass = require('gulp-sass'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
//images |
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
Something |
OlderNewer