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
Object.defineProperty( | |
Object.prototype, 'inspect_walk', { | |
enumerable: false, | |
value: function (compare, callback) { | |
var visited = []; | |
var stack = [{ | |
'path' : [], | |
'key' : '', | |
'value' : this |
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/bash | |
set -e | |
BACKUP_FOLDER='/srv/backups/uploads' | |
SOURCE_FOLDER='/var/www/awesomesite/wp-content/uploads' | |
PREFIX_NAME='awesomesite' | |
# ----------------------------------------------------- | |
woy=`date +%W` # muda toda segunda-feira |
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
fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=php_cache:100m inactive=1d; | |
fastcgi_cache_key "$scheme://$host$request_uri"; | |
server { | |
listen 80; | |
server_name montefuscolo.com.br www.montefuscolo.com.br; | |
return 301 https://montefuscolo.com.br$request_uri; | |
} | |
server { |
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/bash | |
S3CMD='/opt/s3cmd/bin/s3cmd' | |
BUCKET='bucketname' | |
PREFIX='/any-placeholder' | |
BACKUP_FOLDER=/var/backup/mysql | |
BACKUP_FILE_NAME="`date +%Y%m%d`-%s.sql" | |
BACKUP_EXPIRY_DAYS=180 | |
MYSQL_USR='root' |
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/bash | |
BACKUP_FOLDER=/data/sql-backup | |
BACKUP_FILE_NAME="`date +%Y%m%d`.sql.gz" | |
EXEC="docker exec -u postgres -i postgis" | |
databases=$( | |
$EXEC psql -l -A -t | awk -F\| '!/^(postgres|template)/{ print $1 }' | |
) |
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
Object.defineProperty(Element.prototype, 'outerHeight', { | |
'get': function(){ | |
var height = this.clientHeight; | |
var computedStyle = window.getComputedStyle(this); | |
height += parseInt(computedStyle.marginTop, 10); | |
height += parseInt(computedStyle.marginBottom, 10); | |
height += parseInt(computedStyle.borderTopWidth, 10); | |
height += parseInt(computedStyle.borderBottomWidth, 10); | |
return height; | |
} |
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 ($) { | |
$.shuffle = function shuffle(array) { | |
if(!array) { | |
if ($.isArray(this)) { | |
array = this | |
} else { | |
array = $(this); | |
} | |
} |
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 | |
/** | |
* Given some parameters, return the first valid one | |
* Ex.: | |
* echo first_of(false, 0, null, 'is valid', 'me too'); | |
* >> is_valid | |
* | |
* @param type|mixed any param | |
* @return type|mixed the first valid param | |
*/ |
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/bash | |
PORT=1500 | |
PROGRAM=$(readlink -f $0) | |
GIT=$(which git) | |
NCAT=$(which ncat) | |
MAKE=$(which make) | |
SLACK_URL="https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX" | |
SLACK_BOT_NAME="Tripa-Seca" |
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
server { | |
listen 80; | |
server_name example.com; | |
root /srv/www/wordpress-ms; | |
gzip on; | |
gzip_disable "msie6"; | |
gzip_min_length 1100; | |
gzip_buffers 16 8k; |