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 | |
$now = time(); | |
$locales = `locale -a`; | |
$locales = preg_split('/\s/is', $locales); | |
//var_dump($locales); exit; | |
echo "<ul>"; |
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
# | |
# Acts as a nginx HTTP proxy server | |
# enabling CORS only to domains matched by regex | |
# | |
server { | |
listen 80; | |
server_name corsproxy.mydomain.com; | |
location / { | |
proxy_redirect off; |
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
{% for topic in data.topic_list.topics|slice(0,5) %} | |
• | |
<a target="_blank" href="https://meta.discourse.org/t/{{topic.slug}}/{{topic.id}}"> | |
{{topic.title}} | |
</a> | |
{% endfor %} |
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 | |
$s = 'Iñtërnâtiônàlizætiøn-р X'; | |
$pdo = new PDO('mysql:host=localhost;dbname=fa', '...', '...', [ | |
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET CHARACTER SET utf8', | |
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION | |
]); | |
$res = $pdo->query('SELECT label FROM connectors WHERE id = 18', PDO::FETCH_COLUMN, 0); | |
$sDB = $res->fetchColumn(); |
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 | |
namespace _\sys; | |
use RuntimeException; | |
class BackgroundProcess | |
{ | |
/** | |
* Theory: |
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
# WWW HTTP(S) -> non-WWW | |
server { | |
listen 80; | |
#listen 443 ssl; | |
server_name www.EXAMPLE.COM; | |
return 301 $scheme://EXAMPLE.COM$request_uri; | |
#ssl_certificate /home/USER/.ssl/ssl-unified.crt; | |
#ssl_certificate_key /home/USER/.ssl/ssl.key; | |
} |
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
# Add locale to the list of generated locales | |
echo ru_RU.UTF-8 UTF-8 >> /var/lib/locales/supported.d/local | |
# Regenerate list (it will invoke locale-gen...) | |
dpkg-reconfigure locales | |
# Set default passwords for mysql | |
# TODO: Setting blank password does not work (?) | |
debconf-set-selections <<< 'mysql-server mysql-server/root_password password' | |
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password' |
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
# WWW HTTP -> non-WWW | |
server { | |
listen 80; | |
server_name www.example.com; | |
return 301 $scheme://example.com$request_uri; | |
} | |
server { | |
listen 80; |
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
# WordPress single blog rules. | |
# Designed to be included in any server {} block. | |
index index.php; | |
# This order might seem weird - this is attempted to match last if rules below fail. | |
# http://wiki.nginx.org/HttpCoreModule | |
location / { | |
try_files $uri $uri/ /index.php?q=$uri&$args; | |
} |
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
# Global restrictions configuration file. | |
# Designed to be included in any server {} block. | |
location = /favicon.ico { | |
log_not_found off; | |
access_log off; | |
} | |
location = /robots.txt { | |
allow all; | |
log_not_found off; |