Skip to content

Instantly share code, notes, and snippets.

View Burick's full-sized avatar
🏠
Работаю из дома

Burick Burick

🏠
Работаю из дома
View GitHub Profile
@Burick
Burick / Create_IsoCam.py
Created October 12, 2022 21:59 — forked from krasnovpro/Create_IsoCam.py
Creates a true isometric camera in blender
# This script creates two kinds of isometric cameras.
#The one, TrueIsocam called camera, is the mathematical correct isometric camera with the 54.736 rotation to get the 30 degrees angles at the sides of the rhombus.
#The other, GameIsocam called camera, is a camera with which you can render isometric tiles for a 2d game. Here we need a 60 degrees angle instedad of the 54.736 one to get a proper stairs effect and a ratio of 2:1
# Then there is the special case with a 4:3 ratio, which is button 3. You can also make 2D games with that one. The view is more topdown though as with a 2:1 ratio of the traditional game iso view.
# The fourth button creates a simple groundplane where you can place your stuff at.
#You can of course set up everything by hand. This script is a convenient solution so that you don't have to setup it again and again.
# The script is under Apache license
@Burick
Burick / .htaccess
Created February 27, 2021 23:13 — forked from splittingred/.htaccess
Example of how to use new REST server class in MODX 2.3+
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^(.*)$ rest/index.php?_rest=$1 [QSA,NC,L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ rest/index.php [QSA,NC,L]
</IfModule>
@Burick
Burick / mixin breakpoint
Created October 24, 2020 10:38
Миксин брекпонинтов
@mixin breakpoint($point){
@if $point == xs {
@media (min-width: 36em) {@content;}
}
@else if $point == sm {
@media (min-width: 48em) {@content;}
}
@else if $point == md {
@Burick
Burick / nodejs-cheatsheet.js
Created December 10, 2018 18:07 — forked from LeCoupa/nodejs-cheatsheet.js
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@Burick
Burick / resizer.php
Created April 5, 2018 11:40
Модификатор картинок контента
<?php
/**
*
*
*
*
*/
@Burick
Burick / htaccess.expires.headers
Created January 26, 2018 12:50 — forked from solancer/htaccess.expires.headers
htaccess expires headers
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 year"
# Data interchange
ExpiresByType application/atom+xml "access plus 1 hour"
@Burick
Burick / diff.js
Last active January 4, 2018 02:57
Возвращает разность массивов
let row = [1,2,3,4,5,6,7]
let films = [4,5,6,7,8,8,9]
function diff(row,films) {
let out_arr = [];
films.forEach(element => {
let idx = row.indexOf(element);
if(idx < 0) out_arr.push(element);
@Burick
Burick / mysql_real_escape_string.js
Last active January 3, 2018 23:41 — forked from zirosas/mysql_real_escape_string.js
замена функции mysql_real_escape_string
function mysql_real_escape_string (str) {
if(!str) return '';
return str.replace(/[\0\x08\x09\x1a\n\r"'\\\%]/g, function (char) {
switch (char) {
case "\0":
return "\\0";
case "\x08":
return "\\b";
case "\x09":
return "\\t";
@Burick
Burick / AutoLangSnip.php
Last active November 6, 2019 20:31
Автоопределение языка пользователя MODX Revo
<?php
$browserLang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); // Определяем язык пользователя
$contextLang = $modx->context->config['cultureKey']; // Код контекста
$selectLang = isset($_COOKIE['selectLang']) ? $_COOKIE['selectLang'] : false; // Изменялся ли язык (клик по флагу)?
$changeLang = isset($_GET['lang']) ? $_GET['lang'] : false; // Если в адресной строке есть есть параметр GET['lang'] - пользователь хочет изменить язык сайта
if(!$changeLang)
{
if($contextLang == 'ru' && (($selectLang == 'en' && $_SERVER['REQUEST_URI'] == '/ru/') || ($selectLang == false && $browserLang == 'en' && $_SERVER['REQUEST_URI'] == '/ru/')))
{
@Burick
Burick / LangRouter.php
Created December 22, 2017 19:53 — forked from fomigo/LangRouter.php
Language context router for use with Babel extra for MODX Revolution
<?php
/* LangRouter
* ==========
*
* This plugin is meant to be used with Babel extra for MODX Revolution. It
* takes care of switching contexts, which hold translations, depending on URL
* requested by client. LangRouter works with so called subfolder based setup,
* in which many languages are served under a single domain but are
* differentiated by a virtual subfolder indicating the language, eg.
* mydomain.com/pl/.