Skip to content

Instantly share code, notes, and snippets.


Bogdan insane-dev

View GitHub Profile
roxblnfk / !
Last active Nov 18, 2021
View !

Cycle ORM V2 (dev)

Gist is dedicated to general changes in Cycle ORM 2.0 in relation to the first version.
It is being developed in the 2.0.x-dev branch and will be updated as updates are made.


In the composer.json set the directive minimum-stability: "dev",
then run composer require cycle/orm "2.0.x-dev" (or add by hand).

cecilemuller /
Last active Jan 27, 2022
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

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

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

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
leto / gist:691336b4c14f6e0371d54c1e5ed6476d
Created Aug 3, 2016
onbeforeunload from wordpress plugin
View gist:691336b4c14f6e0371d54c1e5ed6476d
window.onbeforeunload = function(e) {
var e = e || window.event;
if (e) {
e.returnValue = wpp.exit_alert_text;
setTimeout( function(){

HTML + CSS [1 / 4]


Есть блок с шириной 470px. Нужно вывести в нем список из 9 квадратов зеленого цвета размером 150px * 150px с расстоянием друг от друга по 10px. Схема изображена на рисунке. Использовать нужно приведенный ниже html код. Фактически от вас требуется написать css.


/* тут будет ваш css код */
BenMorel / viewport-units-ios.scss
Last active Jan 15, 2022
SCSS mixin to support vh and vw units on all iOS Safari versions. Based on an idea by Patrick Burtchaell's:
View viewport-units-ios.scss
* Fix for vw, vh, vmin, vmax on iOS 7.
* This fix works by replacing viewport units with px values on known screen sizes.
* iPhone 6 and 6 Plus cannot run iOS 7, so are not targeted by this fix.
* Target devices running iOS 8+ will incidentally execute the media query,
* but this will still produce the expected result; so this is not a problem.
lttlrck / gist:9628955
Created Mar 18, 2014
rename git branch locally and remotely
View gist:9628955
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
prime31 / gist:5675017
Last active Jan 24, 2022
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
View gist:5675017
// API access key from Google API's Console
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array