- Make sure you have yo installed:
npm install -g yo
- Run:
yo webapp
- Install grunt-contrib-jade:
npm install grunt-contrib-jade --save-dev
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
void bounce(){ | |
if ( (location.x > width) || (location.x < 0) ) { | |
velocity.x = velocity.x * -1; | |
} | |
if ( (location.y > height) || (location.y < 0) ) { | |
velocity.y = velocity.y * -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
void checkEdges() { | |
if (location.x > width) { | |
location.x = 0; | |
} else if (location.x < 0) { | |
location.x = width; | |
} | |
if (location.y > height) { | |
location.y = 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
var countDown = function (endDate, el) { | |
el = el || $('body'); | |
var leadingZero = function (nb) { | |
return (nb < 10) ? "0" + nb : + nb; | |
}; | |
var updateTimer = function (seconds) { | |
var days = Math.floor(seconds / 86400); | |
seconds -= days * 86400; | |
var hours = Math.floor(seconds / 3600); | |
seconds -= hours * (3600); |
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
try{ | |
// Your code here | |
// If an error occures, catch it and show me | |
} catch( err ){ | |
alert( "Error at line # " + err.line.toString() + "\r" + err.toString() ); | |
} |
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
/* Get layers names from a composition */ { app.beginUndoGroup("Demo Script"); var proj = app.project; var myFirstComp = proj.item(1); var myList = new Array(); for( var i=1; i <= myFirstComp.numLayers; i++ ){ myList[ myList.length ] = myFirstComp.layer(i).name; } var myListCorrected = myList.toString().replace( new RegExp( ",", "g" ), "\r" ); alert (myFirstComp.name + ":\r" + myListCorrected); app.endUndoGroup(); } |
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 solids to multiple compositions */ try{ // Variables var proj = app.project; var itemsTotal = proj.numItems; var solidColor = [0, 0, 1]; var curItem, curItemLayers, compName, compWidth, compHeight, compPAR, compDur, solidName, curSolid, totalComps; var itemAry = new Array(); // Loop through project item app.beginUndoGroup("Add new solids"); for( var i=1; i<= itemsTotal; i++ ){ // Item assignment curItem = proj.item(i); // Check if item is a comp if ( curItem instanceof CompItem ){ itemAry[itemAry.length] = curItem; } } totalComps = itemAry.length; for( var c=0; c<totalComps; c++ ){ // Variable assignment curItemLayers = itemAry[c].layers; compName = itemAry[c].name; compWidth = itemAry[c].width; compHeight = itemAry[c].height; compPAR = itemAry[c].pixelAsp |
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_filter('post_thumbnail_html', 'slug_responsive_img', 5, 5); | |
//Image sizes for Interchange | |
add_image_size( 'fd-lrg', 1024, 99999); | |
add_image_size( 'fd-med', 768, 99999); | |
add_image_size( 'fd-sm', 320, 9999); | |
function slug_responsive_img($html, $post_id, $post_thumbnail_id, $size, $attr) { | |
//make image links | |
$attachment_id = $post_thumbnail_id; | |
$default = wp_get_attachment_image_src($attachment_id); |
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://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
/* | |
This sketch demonstrates the use of OSC in Resolume Avenue 3 and TouchOSC | |
an application made for the iPhone that can send OSC messages. | |
So install TouchOSC on your Iphone or Ipod touch (available in the App store) | |
*/ | |
// start OSC config | |
import oscP5.*; | |
import netP5.*; | |
OlderNewer