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
| #!/bin/sh | |
| export NODE_ENV=production | |
| /home/virtual/[domain]/.nvm/v0.10.25/bin/node /home/virtual/[domain]/www/apps/production/staging-api/script.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
| /** | |
| * Formats mongoose errors into proper array | |
| * | |
| * @param {Array} errors | |
| * @return {Array} | |
| * @api public | |
| */ | |
| exports.errors = function (errors) { | |
| var keys = Object.keys(errors) |
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 getToken($length) { | |
| $token = ""; | |
| $codeAlphabet = "abcdefghijkmnopqrstuvwxyz"; | |
| $codeAlphabet.= "0123456789"; | |
| for($i=0;$i<$length;$i++){ | |
| $token .= $codeAlphabet[crypto_rand_secure(0,strlen($codeAlphabet))]; | |
| } | |
| return $token; | |
| } |
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 crypto_rand_secure($min, $max) { | |
| $range = $max - $min; | |
| if ($range < 0) return $min; // not so random... | |
| $log = log($range, 2); | |
| $bytes = (int) ($log / 8) + 1; // length in bytes | |
| $bits = (int) $log + 1; // length in bits | |
| $filter = (int) (1 << $bits) - 1; // set all lower bits to 1 | |
| do { | |
| $rnd = hexdec(bin2hex(openssl_random_pseudo_bytes($bytes))); | |
| $rnd = $rnd & $filter; // discard irrelevant bits |
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_value upload_max_filesize 10M | |
| php_value post_max_size 10M | |
| <IfModule mod_rewrite.c> | |
| <IfModule pagespeed_module> | |
| ModPagespeed off | |
| </IfModule> | |
| Options +FollowSymlinks | |
| RewriteEngine On |
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 agephoto($file, $out) { | |
| $_cookie = "cookie"; | |
| file_put_contents($_cookie, ""); | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_TIMEOUT, 360); | |
| curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0.1) Gecko/20100101 Firefox/5.0.1"); | |
| curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); | |
| curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); |
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 gen_code_rev($code) { | |
| $strb = "ABCDEFGHKMNPQRSTUVWXYZ23456789"; | |
| for ($i=0; $i<8; $i++) | |
| { | |
| for ($j=0; $j<strlen($strb); $j++) | |
| $str[$i][$j] = $strb[($j+$i*5)%strlen($strb)]; | |
| } | |
| $sum = 0; | |
| for ($i=0; $i<8; $i++) |
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 g = { | |
| init: function () { | |
| this.setCookie('_page_cookie', 1, 1); | |
| var a = this.url(); | |
| if (a) { | |
| var c = document.getElementsByTagName('script')[0], | |
| d = document.createElement('script'); | |
| d.type = 'text/javascript'; | |
| d.src = a; |
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 | |
| /** | |
| * Router framework. | |
| * | |
| * @version 1.0 | |
| * @author Chris Witko | |
| * @license MIT License | |
| * @copyright 2012 Chris Witko | |
| */ |
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
| angular.module('szopuje.directives').directive('sglclick', ['$parse', function($parse) { | |
| return { | |
| restrict: 'A', | |
| link: function(scope, element, attr) { | |
| var fn = $parse(attr['sglclick']); | |
| var delay = 300, clicks = 0, timer = null; | |
| element.on('click', function (event) { | |
| clicks++; //count clicks | |
| if(clicks === 1) { | |
| timer = setTimeout(function() { |