Skip to content

Instantly share code, notes, and snippets.

@wateryoma
wateryoma / nginx.conf
Created January 16, 2017 23:15 — forked from anop72/nginx.conf
nginx use cookie as cache key
# guide https://www.nginx.com/blog/nginx-caching-guide/
# document for variable http://nginx.org/en/docs/http/ngx_http_core_module.html#Variables
server {
...
location / {
# point is cookie name shouldn't contain - (hyphen), it cause wrong hash key.
# example $cookie_gist_var
proxy_cache_key $proxy_host$request_uri$cookie_{cookieNameShouldNotContainHyphen};
...
}
@wateryoma
wateryoma / nginx.conf
Created January 10, 2017 16:39 — forked from turtlesoupy/nginx.conf
node.js upstream nginx config
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
@wateryoma
wateryoma / cors-nginx.conf
Created December 17, 2016 00:48 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@wateryoma
wateryoma / RiderUnityIntegration.cs
Created July 6, 2016 07:48 — forked from van800/RiderUnityIntegration.cs
Unity JetBrains Rider Integration
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;
using Debug = UnityEngine.Debug;
@wateryoma
wateryoma / 7za_bitrix
Created August 27, 2014 17:23
Create 7za bitrix backup upload dir excluded
7za a -mx=9 -v100m site_name_excluded_upload_dir_date.7z /home/bitrix/www/ -x\!www/upload -x\!www/bitrix/backup
@wateryoma
wateryoma / user_ department_check.php
Created August 27, 2014 16:10
BITRIX: Is User in department check. Check if user in department, or subdepartment.
<?php
/**
* check if user in department
*
* @param int $iUserID
* @param int $iDepartmentID
* @param bool $bCheckSubDepartments
* @return bool
*/
function IsInDepartment($iUserID, $iDepartmentID, $bCheckSubDepartments = true)