Синхронизация настроек Sublime Text 3
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 python2 | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select |
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 | |
/** | |
* Skeletal sample shortcode | |
*/ | |
add_shortcode( 'pilau-sample', 'pilau_sample_shortcode' ); | |
function pilau_sample_shortcode( $atts ) { | |
extract( shortcode_atts( array( | |
'text' => '' | |
), $atts ) ); |
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
/* | |
* Carousel JavaScript | |
*/ | |
/* Trigger when DOM has loaded */ | |
jQuery( document ).ready( function( $ ) { | |
// Initialize | |
pilau_carousels.wrapper = $( '#carousels' ); |
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
Gists for SublimeText3 | |
********************** | |
Настройка GitHub Gist в sublime text 3 | |
------------------------------------ | |
Первым делом нам нужно сгенерировать token. | |
------------------------------------------ | |
Переходим на свой гитхаб, идем в settings и там в пункте Applications жмем Generate new token | |
Далее называем его как угодно и выбираем только один пункт gist и жмем генерировать. | |
Теперь устанавливаем полученный token в preferences => Package Settings => Gits => Settings-Default |
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
Развертывание на vps Django с Postgres, Nginx, и Gunicorn на Ubuntu 18.04 | |
************************************************************************* | |
1.Создаем пользователя с предоставлением рут прав: | |
-------------------------------------------------- | |
adduser awsnrusl | |
usermod -aG sudo awsnrusl | |
проверяем: | |
groups awsnrusl |
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 XX.XX.XX.XX:80; | |
server_name mysite.ru; | |
root /var/www/mysite.ru; | |
index index.php index.html index.htm; | |
error_log /var/log/nginx/mysite.ru_error.log; | |
access_log /var/log/nginx/mysite.ru_access.log main; | |
set $fastcgipass unix:/var/lib/php5-fpm/mysite.sock; |
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
user www-data; | |
worker_processes auto; | |
worker_cpu_affinity auto; | |
worker_rlimit_nofile 10000; | |
worker_shutdown_timeout 30; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 1024; | |
# Для Linux 2.6+ - epool, Для FreeBSD - kqueue |
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
// Image resize with nginx (this is replace phpThumb script) | |
function escapeRegExp(str) { | |
return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); | |
} | |
function replaceAll(str, find, replace) { | |
return str.replace(new RegExp(escapeRegExp(find), 'g'), replace); | |
} |
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
# Image resize with nginx (this is replace phpThumb script) | |
js_include mysite.js; | |
js_set $js_get_uri_src_dirname js_get_uri_src_dirname; | |
js_set $js_get_image_uri js_get_image_uri; | |
js_set $js_get_image_filename js_get_image_filename; | |
js_set $js_get_resized_image_filename js_get_resized_image_filename; | |
server { | |
set $dm mysite.ru; | |
set $cs utf-8; |
OlderNewer