Skip to content

Instantly share code, notes, and snippets.

View odragora's full-sized avatar

Oleg Dragora odragora

  • Saint Petersburg, Russia
View GitHub Profile
@byrro
byrro / FuncTools.gd
Last active July 3, 2023 11:31
Algorithms to merge Dictionaries and Arrays in GDScript (Godot Engine), with support for shallow and deep merging
extends Node
func merge_array(array_1: Array, array_2: Array, deep_merge: bool = false) -> Array:
var new_array = array_1.duplicate(true)
var compare_array = new_array
var item_exists
if deep_merge:
compare_array = []
@aahung
aahung / README.md
Created January 31, 2021 05:49 — forked from ascendbruce/README.md
Use mac style keyboard shortcuts on Windows with AutoHotkey (ahk) script

Use (most) macOS style keyboard shortcuts on Windows

Make Windows PC's shortcut act like macOS (Mac OS X)

With this AutoHotKey script, you can use most macOS style shortcuts (eg, cmd+c, cmd+v, ...) on Windows with a standard PC keyboard.

Note that

  1. You should disable the Between input languages shotcut from Control Panel\Clock, Language, and Region\Language\Advanced settings > Change lanugage bar hot keys because it conflicts with cmd + shift + ↑ / ↓ / ← / → (select text between cursor and top / bottom / beginning of line / end of line)
  2. you shouldn't change the modifier keys mapping with keyboard DIP. This script assumes you use a standard PC keyboard layout, and wish to use shortcuts as if it was a mac keyboard layout.
@capturetheflag
capturetheflag / safari-print.js
Created March 11, 2019 16:26
window.print() and Safari's print confirmation dialog
// If a user cancels print and then tries to print again, Safari will display its print confirmation dialog.
// We want to perform some actions as soon as printing finishes, neither earlier nor later.
// The problem is: Safari's print confirmatiog dialog does not stop JS code execution flow
// therefore all lines below window.print() are executed before actual printing starts
// More details here: https://stackoverflow.com/q/50455545/1177964
// Tested to work in: Safari 12, macOS 10.14 (Mojave)
function safariPrint() {
// Safari
if (!window.onafterprint) {
@RockinPaul
RockinPaul / sourceTree_device_not_configured.txt
Last active April 15, 2024 18:35
SourceTree: Device not configured (on MacOS)
In console:
git config credential.helper
You will see: osxkeychain
git config credential.helper sourcetree
Then if you perform git config credential.helper again
You will see: sourcetree
@zmts
zmts / tokens.md
Last active May 31, 2024 14:58
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

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

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@bortunac
bortunac / diff.js
Last active January 3, 2018 07:58
detect and react raw javascript object changes
gettype = function (x) {
return {}.toString.call(x).match(/\s([a-zA-Z]+)/)[1];
};
diff = function () {
this.comp=null; // comparation object
this.hnd=function(){}; // no function
};
@macieksk
macieksk / google_drive_util.py
Created July 2, 2014 12:26
A simple Python module to upload files to Google Drive file upload. Needs a file 'client_secrets.json' in the directory . The file can be obtained from https://console.developers.google.com/ -- under APIs&Auth/Credentials/Create Client ID for native application
## Simple Python module to upload files to Google Drive
# Needs a file 'client_secrets.json' in the directory
# The file can be obtained from https://console.developers.google.com/
# under APIs&Auth/Credentials/Create Client ID for native application
# To test usage:
# import google_drive_util
# google_drive_util.login()
# google_drive_util.test()
@revolunet
revolunet / angularjs.md
Last active October 22, 2021 00:36
BeerJS + AngularJS Paris le 25/2

AngularJS best ressources

Following the AngularJS PARIS meetup (25/2 à 19h à Paris with @sampaccoud @dzen @_kemar @tchack13 @vinz et @revolunet)

Here's our best AngularJS ressources : twitter, github, articles & blogs. Please comment and add your good stuff !

@gre
gre / easing.js
Last active May 17, 2024 03:33
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {