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 loadSound(name) { | |
function () { | |
'use strict'; | |
var init, | |
Howl = Howl || null, | |
//change this | |
assetSource = 'path/to/sounds'; |
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
// Feature routing - here we can create seamless redirects based on features | |
app.run(/* ngInject */ function ($state, $rootScope) { // ngAnnotate | |
$rootScope.$on('$stateChangeStart', function (e, toState) { | |
// 1. Dashboard disabled - when we want to go to it ("root" state) we should get a project list instead | |
if (toState.name === 'root') { | |
if (!features.active('dashboard')) { // an example feature checker | |
$state.go('root.project.list'); | |
e.preventDefault(); | |
} | |
} |
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
// A reference to the top-level displayObjectContainer | |
var scene; | |
// Definition | |
var addToCanvas = function (options) { | |
var container = options.container, | |
object = options.object, | |
at = options.at; | |
/** |
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
<meta name="viewport" | |
content="width=device-width, initial-scale=1, minimal-ui, minimum-scale=1, maximum-scale=1, user-scalable=no"> |
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
// Cleaning up pixi sprite reference arrays | |
// Don't | |
var elements = []; | |
function() { | |
elements.forEach(function (element) { | |
element.parent.removeChild(element); | |
element = null; | |
}); |
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
//convert | |
for i in *.wav; do lame -b 320 -h "${i}" "${i}.mp3"; done | |
//remove the .wav part | |
for f in *.mp3; do mv "$f" "${f/.*./.}"; done |
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
git submodule foreach -q --recursive 'branch="$(git config -f $toplevel/.gitmodules submodule.$name.branch)" && git checkout $branch' |
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
/*global _li*/ | |
(function (module) { | |
'use strict'; | |
var moduleName = module.get('name'), | |
init; | |
init = function () { | |
module.publish(moduleName + '.events'); // fire other exposed module |
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 fixIframe() { | |
// get the images | |
var images = $("img[src*=imgur]"); | |
images.each(function(i, image) { | |
var $image = $(image), | |
iframe, | |
content; | |
// wrap each image into an iframe that pretends we load the images from our local computer |
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
#include <thread> | |
#include <future> | |
#include <chrono> | |
#include <iostream> | |
#include <vector> | |
double runMeAsync(int n) { | |
n *= 10000000; | |
for (unsigned i = 0; i < 100000000; i++) { | |
n++; |
OlderNewer