Skip to content

Instantly share code, notes, and snippets.

View zorgsoft's full-sized avatar
🏠
Working from home

Sergey Agarkov zorgsoft

🏠
Working from home
View GitHub Profile
@zorgsoft
zorgsoft / .htaccess
Created January 9, 2020 10:02 — forked from mnoskov/.htaccess
Запись всех POST-запросов к сайту
php_value open_basedir "/path:/tmp"
php_value mail.add_x_header 1
php_value mail.log /path/mail.log
php_value auto_prepend_file /path/postlogger.php
@zorgsoft
zorgsoft / date.php
Last active March 1, 2021 13:25
MODx Evo DocLister RSS
<?php
// Сниппет date
// Форматирование даты
if(!isset($en)){
setlocale(LC_ALL, 'ru_RU.UTF-8', 'ru', 'russian');
} else {
setlocale(LC_ALL, 'en_US.UTF-8', 'en', 'english');
}
$date = isset($date)?(isset($sqldate)?$date:strtotime($date)):time();
return strftime(isset($format)?$format:'%d-%m-%Y', $date);
@zorgsoft
zorgsoft / build_android.bat
Created November 14, 2017 17:05 — forked from Calinou/build_android.bat
Compile Godot for Android easily (on Windows)
:: This script must be run from a Windows machine with
:: Android SDK and NDK installed.
:: NOTE: You need Pywin32 to be installed to use multi-threaded compilation.
:: You may need to set "threads" to 1 for the first build, even if you have it installed.
:: Place this script at the root of your Godot Git clone.
:: CC0 1.0 Universal
set threads=%NUMBER_OF_PROCESSORS%
@zorgsoft
zorgsoft / godot_android.bat
Created November 14, 2017 17:00 — forked from Calinou/godot_android.bat
Compile Godot for Android (from Windows)
@ECHO OFF
set threads=%NUMBER_OF_PROCESSORS%
call scons platform=android tools=no target=release_debug verbose=no warnings=no progress=no -j%threads%
call scons platform=android tools=no target=release verbose=no warnings=no progress=no -j%threads%
cd platform\android\java\
call gradlew build
@zorgsoft
zorgsoft / build_windows.bat
Last active February 9, 2018 14:33 — forked from Calinou/build_windows.bat
Compile Godot 2.x for Windows easily (with a script encryption key if necessary)
:: This script must be run from a Windows machine with
:: Visual Studio 2017, Python 2.7 and SCons installed at their
:: default locations. 7-Zip also needs to be installed (to compress editor binaries).
:: UPX: https://upx.github.io/
:: NOTE: You need Pywin32 to be installed to use multi-threaded compilation.
:: You may need to set "threads" to 1 for the first build, even if you have it installed.
:: Place this script at the root of your Godot Git clone.
:: CC0 1.0 Universal

Style and conventions

This file attempts to outline various naming and structure conventions, that are to be used throughout the project.

General

  • Files end with one newline.
  • Use Tab characters for indentation.
    • If in the indented block there is an empty line, indent it also to the same level as the rest of the block to make it clear where the block starts and ends.
  • Whenever possible, try to keep line lengths around a maximum of 80 chars.
@zorgsoft
zorgsoft / protectionAgainstReferralSpamHtaccessGen.html
Last active August 29, 2015 14:27
Protection against referral spam for htaccess
<form>
<table style="width: 100%;">
<tr>
<td style="width: 200px;">Ссылки спамеров<br><small>(можно много, но 1 ссылка в 1й строке, без http и www)</small></td>
<td><textarea name="urlList" id="urlList" style="width: 100%; height: 150px;"></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="button" name="start" id="start" value="Создать" calss="btn btn-primary" onclick="cStart();"></td>
</tr>
@zorgsoft
zorgsoft / wp_import.php
Last active May 27, 2022 08:15
MODx Evo module for import posts from Wordpress
<?php
/*
* WP Import, Ver 2015.01.04
* (C) 2015 by ZoRg Soft
* MODx Notes - WP Import модуь для импорта записей из Wordpress
* http://agarkov.org/modx-x/evo-wpimport
*/
$theme = $modx->config['manager_theme'];
$basePath = $modx->config['base_path'];
@zorgsoft
zorgsoft / user.php
Created February 17, 2012 13:48
Использование jQuery и Ajax в Codeigniter (Урок
<div id="ajax_login">
<form action="">
Login: <input type="text" name="user_login" id="user_login"><br>
Password: <input type="password" name="user_password" id="user_password"><br>
<input type="button" name="send_data" id="send_data" value="Send">
</form>
</div>
<script type="text/javascript">
$('#send_data').live('click', (function(){
// Сначала присваеваем переменным значения из наших полей ввода
@zorgsoft
zorgsoft / auth.php
Created February 15, 2012 12:38
Authorization library and models for Codeigniter adn Doctrine ORM
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// Auth Library
class Auth {
public function login($login, $password){
// Login user
$login_user = Doctrine::getTable('users')->findOneBy('login', $login);
if($login_user != NULL and $login_user->password == md5($password) ){
$this->session->set_userdata('isAuthorized', TRUE);
$this->session->set_userdata($login_user);