Skip to content

Instantly share code, notes, and snippets.

View insane-dev's full-sized avatar
🎯
Focusing

Bogdan insane-dev

🎯
Focusing
View GitHub Profile
@insane-dev
insane-dev / make-subl-default-text-editor.sh
Created February 26, 2024 23:31
Change MacOS Sonoma default editor to Sublime 4
# Run in terminal
defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.sublimetext.4;}'
defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add '{LSHandlerContentType=public.data;LSHandlerRoleAll=com.sublimetext.4;}'
# IMPORTANT: You must restart your Mac for the changes to take effect.
@roxblnfk
roxblnfk / !index.md
Last active November 18, 2021 11:27
CYCLE ORM v2 SUMMARY [En]

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.

Installation:

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
cecilemuller / 2019-https-localhost.md
Last active May 2, 2024 16:43
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
zmts / tokens.md
Last active May 6, 2024 20:13
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

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

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@leto
leto / gist:691336b4c14f6e0371d54c1e5ed6476d
Created August 3, 2016 22:01
onbeforeunload from wordpress plugin
window.onbeforeunload = function(e) {
var e = e || window.event;
if (e) {
e.returnValue = wpp.exit_alert_text;
}
setTimeout( function(){
@Cherry-Pie
Cherry-Pie / html-css.md
Last active September 12, 2016 15:12
T-T #1

HTML + CSS [1 / 4]

Q:

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

pic

<style>
/* тут будет ваш css код */
@BenMorel
BenMorel / viewport-units-ios.scss
Last active March 11, 2022 13:15
SCSS mixin to support vh and vw units on all iOS Safari versions. Based on an idea by Patrick Burtchaell's: https://gist.github.com/pburtchaell/e702f441ba9b3f76f587
/**
* Fix for vw, vh, vmin, vmax on iOS 7.
* http://caniuse.com/#feat=viewport-units
*
* 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
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
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