Skip to content

Instantly share code, notes, and snippets.

View nurassyl's full-sized avatar
🎯
Focusing

Nurassyl Aldanov nurassyl

🎯
Focusing
View GitHub Profile
@nurassyl
nurassyl / KeyGenerateCommand.php
Last active October 26, 2020 07:52
Lumen app key generator command
<?php
/**
* Lumen app key generator command
*
* @author Nurasyl Aldan <[email protected]>
*/
namespace App\Console\Commands;
use Illuminate\Support\Str;
@nurassyl
nurassyl / curl.md
Created October 16, 2020 06:27 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@nurassyl
nurassyl / gist:b6d61ef94c227870ae4f6a7c7c77c615
Created September 26, 2020 10:31
Check numeric data type in 1C programming language
// Check numeric data type.
// Check numeric is integer
Функция ЯвлЦелЧсл(Число)
Возврат ТипЗнч(Число) = Тип("Число") И Цел(Число) = Число;
КонецФункции
Функция IsInt(Число)
Возврат ЯвлЦелЧсл(Число);
@nurassyl
nurassyl / parity.php
Created September 26, 2020 08:38
Check number parity
<?php
/**
* Check number parity
*
* @author Nurasyl Aldan <[email protected]>
*/
/**
@nurassyl
nurassyl / is_assoc.php
Last active September 26, 2020 08:29
Check array is associative
<?php
/**
* Check array is associative
*
* @author Nurasyl Aldan <[email protected]>
*/
/**
@nurassyl
nurassyl / mb_capitalize.php
Created September 6, 2020 05:39
PHP string capitalize
<?php
/**
* Multi-bytes capitalize
*
* @author Nurasyl Aldan <[email protected]>
*/
/**
/**
* Combination calculator
*
* @author Nurasyl Aldan <[email protected]>
*/
const factorial = require('./factorial')
function combination(objects, sample) {
if(Math.sign(objects) === -1 || Math.sign(sample) === -1) {
/**
* Permutation calculator
*
* @author Nurasyl Aldan <[email protected]>
*/
const factorial = require('./factorial')
function permutation(objects, sample) {
if(Math.sign(objects) === -1 || Math.sign(sample) === -1) {
/**
* Factorial
*
* @author Nurasyl Aldan <[email protected]>
*/
function factorial(num) {
if(Math.sign(num) === 0) {
return 1
} else if(Math.sign(num) === -1) {
<?php
/**
* PHP function to filter array globally
*
* @author Nurasyl Aldan <[email protected]>
*/
function array_global_filter($array, $callback, $flag = 0) {
$array = array_filter($array, $callback, $flag);