Instance | 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
<?php | |
function camelToTitle($camelStr) | |
{ | |
$intermediate = preg_replace('/(?!^)([[:upper:]][[:lower:]]+)/', | |
' $0', | |
$camelStr); | |
$titleStr = preg_replace('/(?!^)([[:lower:]])([[:upper:]])/', | |
'$1 $2', | |
$intermediate); |
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
//JSON.stringify an associative array using the Array object --> does not work | |
var array1 = new Array(); | |
array1['a'] = { x : 1, y : 2 }; | |
console.log(array1); | |
//outputs : [ a: { x: 1, y: 2 } ] | |
console.log(JSON.stringify(array1)); | |
//outputs : [] |
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
# ROUTER | |
GWS.Router.map (match) -> | |
#match("/").to("home") # home.handlebars gets rendered automatically and mapped to / | |
# according to guide the previous logic shouldn't be needed. but it won't work without it | |
# you can either use model: () -> or | |
# setupController: (controller, model) -> | |
# controller.set 'content', model |
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
[program:myapp] | |
autostart = true | |
autorestart = true | |
command = python /home/pi/myapp.py | |
environment=HOME="/home/pi",USER="pi",SECRET_ID="secret_id",SECRET_KEY="secret_key_avoiding_%_chars" | |
stdout_logfile = /home/pi/stdout.log | |
stderr_logfile = /home/pi/stderr.log | |
startretries = 3 | |
user = pi |
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
location ~ /\.git { | |
deny all; | |
} | |
# or, all . directories/files in general (including .htaccess, etc) | |
location ~ /\. { | |
deny all; | |
} |
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
admin account info" filetype:log | |
!Host=*.* intext:enc_UserPassword=* ext:pcf | |
"# -FrontPage-" ext:pwd inurl:(service | authors | administrators | users) "# -FrontPage-" inurl:service.pwd | |
"AutoCreate=TRUE password=*" | |
"http://*:*@www” domainname | |
"index of/" "ws_ftp.ini" "parent directory" | |
"liveice configuration file" ext:cfg -site:sourceforge.net | |
"parent directory" +proftpdpasswd | |
Duclassified" -site:duware.com "DUware All Rights reserved" | |
duclassmate" -site:duware.com |
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
import time | |
import requests | |
import zlib | |
#!pip install lz4 pylzma zstd | |
import lz4.block | |
import pylzma as lzma | |
import zstd | |
def measure_time_and_compress_decompress(compress_func, decompress_func, data, *args): | |
# Measure compression time |
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 | |
# https://cloud.google.com/compute/docs/faq#find_ip_range | |
# nslookup -q=TXT _cloud-netblocks.googleusercontent.com 8.8.8.8 | |
myarray=() | |
for LINE in `dig txt _cloud-netblocks.googleusercontent.com +short | tr " " "\n" | grep include | cut -f 2 -d :` | |
do | |
myarray+=($LINE) | |
for LINE2 in `dig txt $LINE +short | tr " " "\n" | grep include | cut -f 2 -d :` |
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 | |
if ( ! function_exists('config_path')) | |
{ | |
/** | |
* Get the configuration path. | |
* | |
* @param string $path | |
* @return string | |
*/ |
OlderNewer