Skip to content

Instantly share code, notes, and snippets.

View rmamont's full-sized avatar

RedMamont rmamont

View GitHub Profile
@rmamont
rmamont / modx-snippets.php
Created May 24, 2018 07:27 — forked from christianhanvey/modx-snippets.php
Useful snippets for MODX Revo
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
@rmamont
rmamont / google-dorks
Created May 18, 2018 04:09 — forked from stevenswafford/google-dorks
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
@rmamont
rmamont / js-reference.js
Created December 11, 2017 00:44 — forked from DawnPaladin/js-reference.js
JavaScript reference guide
OBJECTS
=====
// There are two ways you can create objects: Literal notation and construction notation.
//
// Literal notation uses curly braces:
var james = {
job: "programmer",
married: false,
greet: function() {
console.log("Hello!");
@rmamont
rmamont / nginx.default.conf
Created August 8, 2017 06:33 — forked from santoshachari/nginx.default.conf
PHP5.6 and NGINX: Install PHP56-FPM, Nginx & MySQL on EC2 with Amazon Linux AMI
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and php56-FPM
sudo yum install -y nginx php56-fpm
# Install php56 extensions
sudo yum install -y php56-devel php-mysql php56-pdo php56-pear php56-mbstring php56-cli php56-odbc php56-imap php56-gd php56-xml php56-soap
86937 isset
43159 echo
31697 empty
29252 substr
26146 count
24248 is_array
22572 strlen
19365 sprintf
18090 unset
16584 str_replace
@rmamont
rmamont / Factorial in recursive and iterative methods
Created May 3, 2017 01:39
Factorial in recursive and iterative methods
<?php
function factorial_recursive($num)
{
if ($num < 0) {
return 'Param must be larger than zero!!';
}
if ($num < 2) {
return $num;
}
@rmamont
rmamont / calc fibonacci in iterative method
Last active March 29, 2017 06:16
calc fibonacci in iterative method
<?php
function fib($num) {
$iter = function($a, $b, $acc) use (&$iter) {
if ($acc === 0) {
return $b;
}
return $iter($a + $b, $a, $acc - 1);
};
@rmamont
rmamont / calc factorial in iterative method
Last active March 29, 2017 06:16
calc factorial in iterative method
<?php
function fctrl($num) {
$iter = function($num, $acc) use (&$iter) {
if ($num == 1) {
return $acc;
}
return $iter($num - 1, $acc * $num);
};
[
{"caption": "Мозаика", "fields": [
{"field": "is_active", "caption": "Активно", "inputTVtype": "checkbox", "inputOptionValues": "Да==1"},
{"field": "image", "caption": "Картинка", "inputTVtype": "image"},
{"field": "title", "caption": "Название"},
{"field": "article", "caption": "Артикул"},
{"field": "country", "caption": "Страна", "description": "(например, Китай)"},
{"field": "size", "caption": "Размеры, мм", "description": "(например, 300*200)"},
{"field": "is_new", "caption": "Новинка", "inputTVtype": "checkbox", "inputOptionValues": "Да==1"},
]}
@rmamont
rmamont / Resize HDD size in VirtualBox
Created February 12, 2017 23:39
Resize HDD size in VirtualBox
#1
"c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" clonehd
"c:\Users\{%USERPROFILE%}\VirtualBox VMs\VMBitrix5.1.2-i386\VMBitrix5.1.2-i386-disk1.vmdk"
"c:\Users\{%USERPROFILE%}\VirtualBox VMs\VMBitrix5.1.2-i386\VMBitrix5.1.2-i386-disk1.vdi"
--format vdi
#2
"c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd
"c:\Users\{%USERPROFILE%}\VirtualBox VMs\VMBitrix5.1.2-i386\VMBitrix5.1.2-i386-disk1.vdi"
--resize 20000