This file contains hidden or 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
| #!/usr/bin/env node | |
| 'use strict'; | |
| var spawn = require('child_process').spawn; | |
| var args = [ | |
| '--harmony', | |
| 'app/bootstrap.js' | |
| ]; |
This file contains hidden or 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
| // | |
| // SVG — hasClass, addClass, removeClass, toggleClass | |
| // Source: | |
| // https://gist.github.com/branneman/8436956 | |
| // Taken and adapted from: | |
| // http://toddmotto.com/hacking-svg-traversing-with-ease-addclass-removeclass-toggleclass-functions/ | |
| // | |
| if (SVGElement && SVGElement.prototype) { |
This file contains hidden or 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
| // | |
| // Articles controller | |
| // Optional module description line. | |
| // | |
| 'use strict'; | |
| var fs = require('fs'); | |
| var path = require('path'); |
This file contains hidden or 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
| /** | |
| * Strict mode | |
| * Opt in to a restricted variant of JavaScript. | |
| */ | |
| 'use strict'; | |
| (function() { 'use strict'; }); | |
| /** | |
| * Array.prototype.forEach() | |
| * Executes a provided function once per array element. |
This file contains hidden or 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 dump($var) { | |
| ob_start(); | |
| var_dump($var); | |
| $output = ob_get_clean(); | |
| echo preg_replace("/=>(\s+)/m", ' => ', $output); | |
| } |
This file contains hidden or 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() { | |
| var resizeEnd; | |
| $(window).on('resize', function() { | |
| clearTimeout(resizeEnd); | |
| resizeEnd = setTimeout(function() { | |
| $(window).trigger('resizeEnd'); |
This file contains hidden or 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 fs = require('fs'), | |
| exec = require('child_process').exec, | |
| express = require('express'), | |
| app = express(); | |
| app.get('/static/img/*.svg.*.png', function(req, res) { | |
| var pngFile = 'src' + req.url, | |
| svgFile = pngFile.substring(0, pngFile.indexOf('.svg') + 4); | |
| if (!fs.existsSync(svgFile)) { | |
| return res.render('404', { |
This file contains hidden or 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
| // | |
| // asyncParallel(tasks, [callback]) | |
| // | |
| // Run an array of functions in parallel, without waiting until the previous | |
| // function has completed. Once the tasks have completed, final callback is called. | |
| // | |
| // Source: | |
| // https://gist.github.com/branneman/4541190 | |
| // Inspired by: | |
| // https://github.com/caolan/async#parallel |
This file contains hidden or 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 off | |
| @echo This batchfile changes your password 30 times into a temporary password, and finally into your given password. | |
| @echo This way, you can use your 'old' password, when you are forced to change it ;) | |
| SET /P user=username: | |
| SET /P pwd=password: | |
| echo username: %user% | |
| net user %user% C6us4deSAf /domain |
This file contains hidden or 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 | |
| $time1 = explode(' ', microtime()); | |
| $time1 = $time1[1] . substr($time1[0], 1, -2); | |
| // your code | |
| $time2 = explode(' ', microtime()); | |
| $time2 = $time2[1] . substr($time2[0], 1, -2); | |