Skip to content

Instantly share code, notes, and snippets.

@muhittin
muhittin / turkceekler.php
Created August 7, 2011 20:55
Türkçe Ekler
<?php
/*ismin nikneymin sonuna gereken eki ekler */
function isimeki($ad, $ektipi= "in")
{
$sertsessizler = array("ç", "f", "h", "k", "p","s", "ş", "t");
/// türkçe sesli ve sert sessiz karakterler
$buyuk = array("A", "I", "E", "İ", "U","O", "Ü", "Ö", "Ç", "F", "H", "K", "P","S", "Ş", "T");
$kucuk = array("a", "ı", "e", "i", "u","o", "ü", "ö", "ç", "f", "h", "k", "p","s", "ş", "t");
local function string(o)
return '"' .. tostring(o) .. '"'
end
local function recurse(o, indent)
if indent == nil then indent = '' end
local indent2 = indent .. ' '
if type(o) == 'table' then
local s = indent .. '{' .. '\n'
local first = true
@jacobblock
jacobblock / FreeNAS.md
Last active October 22, 2023 13:01
Ultimate FreeNAS Setup

FreeNAS

I started using FreeNAS in August 2013. It is fantastic piece of software and I have been really impressed by the upgrades just in the few months I've been using it. It looks like they recently went to a plugin system as of version 9 to make installing software easier for end users. I've ran into several issues related to plugins and user + group permissions so I decided to just use the available FreeBSD port system. After fiddling for a few days (now turned into months) I believe I have created something helpful for the community and anyone interested in picking up the port system. The sandbox nature of FreeNAS's jail system is especially helpful for playing around without having any consequence on your core system.

Here are straight-forward instructions to setting up a bunch of different software on FreeNAS. If you make a terrible error, just throw up another plugin sandbox and repeat.

ToC

@mborodov
mborodov / bitrix_tips.php
Last active July 13, 2023 13:24
Bitrix Tips
<?php
/**
* Метод получает ссылку на открытие файла в Google Drive
* @param $userId - ID пользователя для диска
* @param $folderId - ID папки в диске
* @param $fileName - Имя файла ддя поиска
* @return bool|string - Возвращаем либо ссылку на google drive либо false
*/
public static function getFileExtLinkFromUserDisk($userId, $folderId, $fileName)
{
@paivaric
paivaric / 1.google-analytics-proxy-nginx.conf
Last active January 30, 2024 17:21
Google Analytics Proxy using Nginx to bypass Adblock and other blockers
server {
listen 80;
server_name your.domain.com;
location = /analytics.js {
# you have to compile nginx with http://nginx.org/en/docs/http/ngx_http_sub_module.html (this is not default)
# and http://nginx.org/en/docs/http/ngx_http_proxy_module.html (it's a default module)
proxy_set_header Accept-Encoding "";
@dale3h
dale3h / jail.local
Created June 29, 2018 15:47
[fail2ban] Improved nginx-badbots
# Add to file: /etc/fail2ban/jail.local
[nginx-badbots]
enabled = true
port = http,https
filter = nginx-badbots
logpath = %(nginx_access_log)s
maxretry = 1
findtime = 604800
bantime = 604800
var originalBxOnCustomEvent = BX.onCustomEvent;
BX.onCustomEvent = function (eventObject, eventName, eventParams, secureParams) {
var logData = {
eventObject: eventObject,
eventName: eventName,
eventParams: eventParams,
secureParams: secureParams
};
<?php
/**
* Код для поиска шаблона Бп по некоторому PHP коду(активити).
* Выполнить код в Командной строке PHP Админки Битрикс24
*/
// Зададим строку для поиска
$findString = 'echo 1';
// Подключим модуь бизнесс процессов
@dhcgn
dhcgn / routerboard.sh
Last active October 6, 2023 23:45
Add Cloudflare IPs to Mikrotik Routerboard
/ip firewall address-list
add list=CF address=173.245.48.0/20
add list=CF address=103.21.244.0/22
add list=CF address=103.22.200.0/22
add list=CF address=103.31.4.0/22
add list=CF address=141.101.64.0/18
add list=CF address=108.162.192.0/18
add list=CF address=190.93.240.0/20
add list=CF address=188.114.96.0/20
add list=CF address=197.234.240.0/22
@iTeeLion
iTeeLion / snippets_bitrix24.php
Last active February 10, 2023 13:46
PHP snippets for bitrix24 / Примеры самых используемых конструкций для bitrix24
<?php
/*
* Snippert for CRM entities:
* Lead - //ToDo
* Deal - //ToDo
* Invoice - //ToDo
* Company - //ToDo
* Contact - //ToDo
* Requisites - //ToDo