Skip to content

Instantly share code, notes, and snippets.

@sleemanj
sleemanj / mt-recap-fix.js
Last active November 16, 2023 10:47
Fix for Mootools 1.3 with 1.2 compatibility layer to work with Recaptcha due to bind being incorrect with 1.2 compatibility enabled.
/* Quick Dirty Patch for Recaptcha with Mootools 1.2 Compatability Layer
*
* Make sure that all your mootools core/more source is loaded before this
* fix is loaded.
*
* @author James Sleeman <james@gogo.co.nz>
* @see https://github.com/google/recaptcha/issues/374
*
*/
@avshatalov48
avshatalov48 / Git.md
Last active April 24, 2024 13:00
Основные "повседневные" команды GIT

Основные "повседневные" команды GIT

  • git status
  • git add .
  • git commit -m "GeekBrains > Yii2 > Lesson 4 > Complete"
  • git push
  • git pull
  • git log
  • git config --list
@geraldvillorente
geraldvillorente / import.md
Created June 14, 2017 05:03
How to import database in MySQL in Docker?

This is a simple way of importing MySQL database in Docker.

  1. In you Dockerfile you must have a shared folder. Shared folder is a directory in your host machine that is mounted to Docker instance.

  2. Put the exported sql file in the shared folder.

  3. Login to your Docker instance via docker exec -it DOCKER_CONTAINER_ID bin/bash.

  4. Login to MySQL via mysql -u USERNAME -p.

@zmts
zmts / tokens.md
Last active May 2, 2024 15:03
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@Mons1eurEnzo
Mons1eurEnzo / component.php
Created January 23, 2017 12:06
Подключаем Recaptcha 2 к Bitrix
//Шаг 2 - в компоненте добавляем проверку:
<?
$recaptcha = new \ReCaptcha\ReCaptcha(RE_SEC_KEY);
$resp = $recaptcha->verify($_REQUEST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
if (!$resp->isSuccess()){
foreach ($resp->getErrorCodes() as $code) {
echo "Ошибка! Проверка не пройдена.";
echo $code;
return;
@odan
odan / xampp_php7_xdebug.md
Last active April 17, 2024 05:36
Installing Xdebug for XAMPP
@hrwgc
hrwgc / validate.sh
Created November 13, 2013 19:57
bash wget - check if file exists at url before downloading
#!/bin/bash
# simple function to check http response code before downloading a remote file
# example usage:
# if `validate_url $url >/dev/null`; then dosomething; else echo "does not exist"; fi
function validate_url(){
if [[ `wget -S --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then echo "true"; fi
}
@rxaviers
rxaviers / gist:7360908
Last active May 4, 2024 14:14
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@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