Skip to content

Instantly share code, notes, and snippets.

View fogrew's full-sized avatar
🚀
Open for new opportunities

Andrew Gurylev fogrew

🚀
Open for new opportunities
View GitHub Profile
@deevroman
deevroman / restore.py
Last active September 30, 2025 10:27
⚠️ Обязательно прочтите комментарии к коду, и укажите время, за которое нужно восстановить историю
# Скрипт для дозагрузки потерянных яндекс.музыкой в конце декабря скробблов
# Если что пишите t.me/Roman_Deev или пингуйте в t.me/yandexvernitescrobbling
# Для начала запросите у яндекса архив данных яндекс.музыки: https://id.yandex.ru/personal/data
# Распакуйте его и положите в одну папку со скриптом файл history.json
# Установите библиотеки
# pip install yandex-music pylast
# В last.fm может показываться местное время. Далее нужно UTC
@Alexs7zzh
Alexs7zzh / .eleventy.js
Created April 24, 2021 04:44
eleventy-img in markdown
const Image = require('@11ty/eleventy-img')
const { parseHTML } = require('linkedom')
module.exports = eleventyConfig => {
if (process.env.ELEVENTY_ENV)
eleventyConfig.addTransform('transform', (content, outputPath) => {
if (outputPath && outputPath.endsWith('.html')) {
let { document } = parseHTML(content)
@jamesog
jamesog / README.md
Last active April 21, 2025 02:02
Yubikey SSH without GPG

Yubikey as an SSH key

All other guides I've seen (https://github.com/drduh/YubiKey-Guide being the most prolific) tell you to use the Yubikey's smartcard (PKCS#11) features with GnuPG via gpg-agent.

STOP THE MADNESS!

OpenSSH has supported OpenSC since version 5.4. This means that all you need to do is install the OpenSC library and tell SSH to use that library as your identity.

Prequisites

@publicarray
publicarray / Nginx.md
Last active March 20, 2025 20:11
Nginx with modules and latest OpenSSL [CentOS]

Nginx/OpenSSL on CentOS

System

  1. Set up iCloud Keychain
  2. Remove icons and hide Dock
  3. Default address in iMessage
  4. Install Updates
  5. Add Ru Input Sources
  6. Set up Shortcuts
  7. Add text shortcuts Text
@rmwxiong
rmwxiong / gist:ad6e922dcc739a599640
Last active May 21, 2020 14:57 — forked from paulirish/gist:357048
Fix for color components with single digit values
// get the average color of two hex colors.
function avgcolor(color1,color2){
var avg = function(a,b){ return (a+b)/2; },
t16 = function(c){ return parseInt((''+c).replace('#',''),16) },
hex = function(c){ var t = (c>>0).toString(16);
return t.length == 2 ? t : '0' + t },
hex1 = t16(color1),
hex2 = t16(color2),
r = function(hex){ return hex >> 16 & 0xFF},
g = function(hex){ return hex >> 8 & 0xFF},
// Underline
@mixin underline($color, $width) {
background:
linear-gradient(
to top,
$color,
$color #{$width}em,
transparent #{$width}em,
transparent
) repeat-x;
@astronom
astronom / browser_detection.js
Created April 7, 2014 17:16
additional browser detection
// from http://ryanmorr.com/the-state-of-browser-detection/
if('opera' in window && ({}).toString.call(window.opera) === '[object Opera]'){
// detect Opera 14-
}
if('operamini' in window && ({}).toString.call(window.operamini) === '[object OperaMini]'){
// detect Opera Mini
}
if('PalmSystem' in window){
// detect webOS
}
@ndarville
ndarville / webm.md
Last active March 11, 2025 17:21
4chan’s guide to converting GIF to WebM - https://boards.4chan.org/g/res/41212767

Grab ffmpeg from https://www.ffmpeg.org/download.html

It's a command line tool which means you will have to type things with your keyboard instead of clicking on buttons.

The most trivial operation would be converting gifs:

ffmpeg -i your_gif.gif -c:v libvpx -crf 12 -b:v 500K output.webm
  • -crf values can go from 4 to 63. Lower values mean better quality.
  • -b:v is the maximum allowed bitrate. Higher means better quality.