Skip to content

Instantly share code, notes, and snippets.

View ewwmy's full-sized avatar
🤌

Andrew A. ewwmy

🤌
  • Moscow, Russia
  • 10:23 (UTC +03:00)
View GitHub Profile
@kepano
kepano / obsidian-web-clipper.js
Last active July 22, 2024 07:29
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@georgiybykov
georgiybykov / git_status_issue_mode_100644_to_100755.txt
Last active February 14, 2024 09:28
old mode 100644 => new mode 100755 issue / После смены ОС и git clone репозитория
После переустановки ОС или клонировании вашего репозитория на другую локальную машину, съемный жесткий диск и прочее
может возникнуть проблема, которая при команде `git status` показывает, что все (или не все) фалы были изменены
хотя вы ничего не изменяли, а только копировали репозиторий:
$ git diff
#=> old mode 100644
new mode 100755
Есть два способа решить эту проблему:
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active July 23, 2024 19:37
crack activate Office on mac with license file
@guettli
guettli / ssh-tunnel@.service
Created December 22, 2017 11:40
Reliable persistent SSH-Tunnel via systemd (not autossh)
# Reliable persistent SSH-Tunnel via systemd (not autossh)
# https://gist.github.com/guettli/31242c61f00e365bbf5ed08d09cdc006#file-ssh-tunnel-service
[Unit]
Description=Tunnel for %i
After=network.target
[Service]
User=tunnel
ExecStart=/usr/bin/ssh -o "ExitOnForwardFailure yes" -o "ServerAliveInterval 60" -N tunnel@%i
@loretoparisi
loretoparisi / ffmpeg_frames.sh
Last active April 19, 2024 05:17
Extract all frames from a movie using ffmpeg
# Output a single frame from the video into an image file:
ffmpeg -i input.mov -ss 00:00:14.435 -vframes 1 out.png
# Output one image every second, named out1.png, out2.png, out3.png, etc.
# The %01d dictates that the ordinal number of each output image will be formatted using 1 digits.
ffmpeg -i input.mov -vf fps=1 out%d.png
# Output one image every minute, named out001.jpg, out002.jpg, out003.jpg, etc.
# The %02d dictates that the ordinal number of each output image will be formatted using 2 digits.
ffmpeg -i input.mov -vf fps=1/60 out%02d.jpg
@zmts
zmts / tokens.md
Last active July 22, 2024 18:25
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

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

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@wpupru
wpupru / Gists for SublimeText3
Created September 23, 2016 16:36
Настройка GitHub Gist в sublime text 3
Настройка GitHub Gist в sublime text 3
Первым делом нам нужно сгенерировать token.
Переходим на свой гитхаб, идем в settings и там в пункте Applications жмем Generate new token
Далее называем его как угодно и выбираем только один пункт gist и жмем генерировать.
Теперь устанавливаем полученный token в preferences => Package Settings => Gits => Settings-Default
Вторым пунктом, настраиваем комбинацию клавиш
Переходим preferences => Package Settings => Gits => Key Bindings-user
И изменяем как нам удобно, вот мой пример
@dtomasi
dtomasi / default
Last active December 8, 2023 04:20
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@aurbano
aurbano / removeKeys.js
Last active November 29, 2022 21:57
Remove a property from a nested object, recursively
/**
* Remove all specified keys from an object, no matter how deep they are.
* The removal is done in place, so run it on a copy if you don't want to modify the original object.
* This function has no limit so circular objects will probably crash the browser
*
* @param obj The object from where you want to remove the keys
* @param keys An array of property names (strings) to remove
*/
function removeKeys(obj, keys){
var index;
@rarylson
rarylson / automator_new_file.scpt
Last active March 1, 2024 01:03
AppleScript to create a new file in Finder (to be used in Automator)
-- AppleScript to create a new file in Finder
--
-- Use it in Automator, with the following configuration:
-- - Service receives: no input
-- - In: Finder.app
--
-- References:
-- - http://apple.stackexchange.com/a/129702
-- - http://stackoverflow.com/a/6125252/2530295
-- - http://www.russellbeattie.com/blog/fun-with-the-os-x-finder-and-applescript