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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
# Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl http2; |
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
# How to Install (LEMP) NginX, MySQL, PHP stack on Arch Linux |
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
# Set cache dir | |
proxy_cache_path /var/cache/nginx levels=1:2 | |
keys_zone=microcache:5m max_size=1000m; | |
# Virtualhost/server configuration | |
server { | |
listen 80; | |
server_name yourhost.domain.com; | |
# Define cached location (may not be whole site) |
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
# nginx site config for processwire with forced SSL and www to non-redirect | |
# redirect from www to non-www forced SSL | |
# uncomment, save file and restart Nginx to enable | |
# if unsure use return 302 before using return 301 | |
server { | |
server_name domain.com www.domain.com; | |
return 301 https://$server_name$request_uri; | |
} |
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
#!/usr/bin/env sh | |
# inspired by https://gist.github.com/johntyree/3331662#gistcomment-1968023 | |
# created by https://gist.github.com/glaszig/bf96beccf4694ae25d4f1f7cc6224985 | |
# usage: | |
# getBlockLists.sh > /tmp/blockp2p.list | |
# or | |
# getBlockLists.sh | gzip -9 > /tmp/blockp2p.list.gz | |
# daily updated: https://silo.glasz.org/antip2p.list.gz | |
# |
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
#!/usr/bin/env bash | |
# convert sql dumps to csv, tsv, ssv... | |
# also can filter fields using a sed pattern | |
# only works on linux | |
function usage | |
{ | |
echo "usage: $0 [-sc CORES] [-o OUTFILE] [-p PATTERN] SQLFILE" 2>&1 && exit 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
<?php | |
/* | |
*from | |
* http://php.net/manual/en/pdostatement.execute.php#111823 | |
* simplified $placeholder form | |
*/ | |
$data = ['a'=>'foo','b'=>'bar']; | |
$keys = array_keys($data); |
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
/* | |
* put this on the very bottom of the functions.php file of your theme | |
* or create manually .maintenance on your web root with desired message | |
*/ | |
// Activate WordPress Maintenance Mode | |
function wp_maintenance_mode(){ | |
if(!current_user_can('edit_themes') || !is_user_logged_in()){ | |
wp_die('<h1 style="color:red">Website under Maintenance</h1><br />We are performing scheduled maintenance. We will be back online shortly!'); | |
} |
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
http://bing.com/webmaster/ping.aspx | |
http://ping.blo.gs/ | |
http://blog.goo.ne.jp/XMLRPC | |
http://blog.with2.net/ping.php | |
http://blogping.unidatum.com/RPC2 | |
http://blogpingr.de/ping/rpc2 | |
https://ping.blogs.yandex.ru/RPC2 | |
http://blogsearch.google.co.cr/ping/RPC2 | |
http://blogsearch.google.co.hu/ping/RPC2 | |
http://api.moreover.com/ping |
OlderNewer