Skip to content

Instantly share code, notes, and snippets.

View BekNaji's full-sized avatar

Bekzod BekNaji

  • Multibank
  • Tashkent, Uzbekistan
View GitHub Profile
@ismailbaskin
ismailbaskin / turkce_isimler.sql
Last active July 22, 2024 17:10
Türkçe isim veritabanı
-- Turkce isimler sozlugu twitter : http://twitter.com/baskindev
CREATE TABLE `isimler` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isimler` varchar(255) DEFAULT NULL,
`cinsiyet` varchar(255) DEFAULT NULL COMMENT 'erkek : E , kadın : K , uniseks : U',
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
-- ----------------------------
@mesilov
mesilov / SetIBlockAdminListDisplaySettings.php
Created August 23, 2012 20:13
Программная настройка столбцов списка элементов ИБ в админке инфоблоков для bitrix
/**
* Настройка столбцов списка элементов ИБ в админке инфоблоков
*
* @param integer $IBlockID — ID инфоблока
* @param string $arIBlockListAdminColumns — символьные коды полей и свойств для показа в списке элементов ИБ
* @param string $orderByColumnName — наименования поля или свойства по которому нудно отсортировать
* @param string $orderDirection - направление сортировки
* @param integer $pageSize - количество элементов на страницу
* @param boolean $isToAllUsers - значение будет для всех, или для текущего пользователя
* @return boolean
@cferdinandi
cferdinandi / has-characters.php
Last active January 7, 2024 11:58
Test strings for letters, numbers, and special characters. Returns true if they exist, false if they don't. Forked from http://stackoverflow.com/a/9588010/1293256
<?php
// Does string contain letters?
function _s_has_letters( $string ) {
return preg_match( '/[a-zA-Z]/', $string );
}
// Does string contain numbers?
function _s_has_numbers( $string ) {
return preg_match( '/\d/', $string );
@maarten00
maarten00 / pmt.js
Created March 19, 2015 09:56
Excel PMT in PHP and JavaScript
/**
* Copy of Excel's PMT function.
* Credit: http://stackoverflow.com/questions/2094967/excel-pmt-function-in-js
*
* @param rate_per_period The interest rate for the loan.
* @param number_of_payments The total number of payments for the loan in months.
* @param present_value The present value, or the total amount that a series of future payments is worth now;
* Also known as the principal.
* @param future_value The future value, or a cash balance you want to attain after the last payment is made.
* If fv is omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0.
@iredun
iredun / dep.php
Created August 12, 2015 08:58
Получить список разделов и их подразделов в 1С - Битрикс
<?
$res = CIBlockSection::GetList(
Array('name' => 'asc'),
Array('IBLOCK_ID' =>'5' , 'ACTIVE' => 'Y')
);
while ($row = $res->GetNext())
{
echo $row['NAME'].'<br>';
$rsParentSection = CIBlockSection::GetByID($row['ID']);
if ($arParentSection = $rsParentSection->GetNext())
@angrycoffeemonster
angrycoffeemonster / Sublime Text 3 Build 3103 License Key - CRACK
Created April 18, 2016 02:13
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@proweb
proweb / index.html
Last active March 24, 2021 10:48
Как разместить две формы Битрикс 24 на сайте.
<div id="my_container"></div> <!-- Form container -->
<!-- JS code from CRM Bitrix24 -->
<!-- Added "node" parametr -->
<script id="bx24_form_inline" data-skip-moving="true">
(function(w,d,u,b){w['Bitrix24FormObject']=b;w[b] = w[b] || function(){arguments[0].ref=u;
(w[b].forms=w[b].forms||[]).push(arguments[0])};
if(w[b]['forms']) return;
s=d.createElement('script');r=1*new Date();s.async=1;s.src=u+'?'+r;
h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h);
})(window,document,'http://cp.silaev.bx/bitrix/js/crm/form_loader.js','b24form');
@danielmcclure
danielmcclure / .htaccess
Last active January 12, 2022 09:53
How to Remove Conflicting X-FRAME-OPTIONS Headers via .htaccess on Apache
# Select one of the following options - Security decreases from top to bottom.
Header append X-FRAME-OPTIONS "DENY"
Header append X-FRAME-OPTIONS "SAMEORIGIN"
Header append X-FRAME-OPTIONS "ALLOW-FROM https://example.com/"
@joeytwiddle
joeytwiddle / async-await-forEach-alternatives.md
Last active July 22, 2024 09:05
Do not use forEach with async-await

Do not use forEach with async-await

TLDR: Use for...of instead of forEach() in asynchronous code.

For legacy browsers, use for...i or [].reduce()

To execute the promises in parallel, use Promise.all([].map(...))

The problem

@larsneo
larsneo / viewer.html
Last active July 24, 2024 03:15 — forked from jsprpalm/viewer.html
Pinch zoom implementation for PDF.js viewer
<!-- Goes into viewer.html just before ending </body> -->
<script>
let pinchZoomEnabled = false;
function enablePinchZoom(pdfViewer) {
let startX = 0, startY = 0;
let initialPinchDistance = 0;
let pinchScale = 1;
const viewer = document.getElementById("viewer");
const container = document.getElementById("viewerContainer");
const reset = () => { startX = startY = initialPinchDistance = 0; pinchScale = 1; };