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 PackageLoader = function() { | |
this.cb = Math.random(0, 100000000000); | |
this.current = 0; | |
this.batches = []; | |
// Load kicks off the entire loading process. | |
this.load = function(config, loadMap, onload) { | |
var scope = this; | |
for(label in loadMap) { | |
scope.batches.push(new PackageBatch(label, loadMap[label])); |
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
#!/bin/bash | |
SITES_AVAILABLE=/etc/apache2/sites-available/ | |
TEMPLATE=$SITES_AVAILABLE$1 | |
NEWVHOST=$SITES_AVAILABLE$2 | |
echo Copying template $TEMPLATE as new virtual host file. | |
sudo cp $TEMPLATE $NEWVHOST | |
echo Enabling new virtual host. |
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
// Usage: | |
//document.write('<scr'+'ipt src="https://requirejs.org/docs/release/2.1.8/comments/require.js"></scr'+'ipt>'); | |
var script = document.createElement('script');script.src = "https://requirejs.org/docs/release/2.1.8/comments/require.js"; | |
document.head.appendChild(script); | |
var oldDollar = $;requirejs(["https://code.jquery.com/jquery-1.10.2.js"], function() { | |
var jQuery = $; | |
var $ = oldDollar; | |
}); |
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
/* Stolen from anonymous234 on http://what.thedailywtf.com/ (http://what.thedailywtf.com/t/banners-that-change-as-you-scroll-down-the-page-and-dont-have-a-close-button/1754/48) */ | |
/* Run to activate remove-clickable elements */ | |
/* Run again to switch off */ | |
javascript:var b=new Array();var c=1;var o=((document.onkeydown==null)||(o==2))?0:1;document.onkeydown=ck;z=document.getElementsByTagName('*');for(i=0;i<z.length;i++){if(z[i].tagName.search(/(HTML|BODY)/i)==-1){z[i].onclick=function(e){t=this;if(window.event) e=window.event;if((t==e.target)||(window.event)) t.parentNode.removeChild(t);e.stopPropagation();return false;};z[i].onmouseover=function(){if(!c)return;c=0;t=this;b[t]=t.style.backgroundColor;t.style.background='#FF9999';};void(z[i].onmouseout=function(){t=this;t.style.backgroundColor=b[t];c=1;});}}function ck(e){k=window.event?window.event.keyCode:e.keyCode;if((k==27)||o){o=2;document.onkeydown=null;for(i=0;i<z.length;i++){if(z[i].tagName.search(/(HTML|BODY)/i)==-1){z[i].onclick=null;z[i].onmouseov |
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
angular.forEach([ /* ... Provide some module names ... */ ], function (moduleName) {console.log(moduleName, angular.module(moduleName).requires);angular.forEach(angular.module(moduleName)._invokeQueue, function(component) {console.log("-", component[1], component[2][0], component); });}); |
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 tileOp = function ($event, fnc, always) { | |
var el = $element.find('.isometric-grid'), | |
x = $event.clientX - el.offset().left + $window.scrollX, | |
y = $event.clientY - el.offset().top + $window.scrollY; | |
$scope.tiles.forEach(function (tile) { | |
always(tile); | |
if (tile.boundsCheck(x - tile.left(), y - tile.top())) { | |
fnc(tile); | |
} |
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 printR = function (obj, indent) { | |
indent = indent || 0; | |
if (typeof obj === "string") { | |
grunt.log.writeln("'" + obj + "'"); | |
} else if (typeof obj === "object") { | |
grunt.log.writeln("{"); | |
Object.keys(obj).forEach(function (key) { | |
grunt.log.write(repeat(" ", indent + 2) + key + ": "); | |
printR(obj[key], indent + 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
# Multi-window terminal | |
sudo apt-get install terminator | |
# Basic IDE | |
sudo apt-get install vim | |
# JRE | |
sudo apt-get install default-jre | |
# Clipboard, useful for copying rsa keys |
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
#!/bin/bash | |
recent_restart=1 | |
while true; do | |
printf $(date +"%Y-%m-%d") | |
printf " " | |
printf $(date +"%H:%M:%S") | |
printf " " | |
if [[ $(ping -c 1 google.com) ]] > /dev/null 2>&1 ; then | |
if [ $recent_restart -eq 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
<?php | |
// Usage example: pdftk stuff.pdf dump_data_fields | php pdf-fields.php | |
$stdin = file('php://stdin'); | |
// print_r($stdin); | |
$data = []; | |
$i = 0; | |
foreach($stdin as $idx => $line) { | |
$chunks = explode(': ', $line); |
OlderNewer