Skip to content

Instantly share code, notes, and snippets.

@m-jovanovic
m-jovanovic / .editorconfig
Created June 7, 2023 12:17
Sample editor config with a bunch of rules turned off 😅
root = true
# C# files
[*.cs]
#### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 4
indent_style = space
@achesco
achesco / shell-snippets.sh
Last active May 7, 2024 11:36
Linux shell snippets
# self sign cert for localhost
openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt
# find folder which content's size less than 10kb
find /volume1/Volume/fapfapbackup -mindepth 1 -maxdepth 1 -type d -exec du -ks {} + | awk '$1 <= 10' | cut -f 2-
# Send output to Telegram, JSON POST with curl
# telelog.sh
LOG=`cat <&0`
curl -H "Content-Type: application/json" \
@xacnio
xacnio / telegram_video_sticker_ffmpeg.md
Last active May 7, 2024 11:33
Telegram - Create Video Sticker (.WEBM) with FFMPEG

Command

ffmpeg -y -i animated_sticker.mov -r 30 -t 2.99 -an -c:v libvpx-vp9 -pix_fmt yuva420p -s 512x512 -b:v 400K output.webm
  • If .webm file size greater than 256 KB, you should reduce "-b:v 400K"
  • .mov video file may has alpha channel but not required.
  • My video sticker pack for example: https://t.me/addstickers/msn_animations

Telegram Sticker Command

Registered Name: https://zhile.io
License Key: 48891cf209c6d32bf4
Maintainers:
opna2608: furnace, furnace, furnace, furnace
@DragoshDX
DragoshDX / app.css
Created April 30, 2024 07:24
pedro spinner
body {
background: #161616;
margin: 0;
height: 100dvh;
display: grid;
place-content: center center;
}
.spinner {
;; example rails like console for compojure showing params, etc. for each request
(ns bus.core
(:use compojure.core
ring.adapter.jetty
...
...
(:use ring.middleware.params))
@bryanjswift
bryanjswift / UAgentInfo.java
Created March 1, 2010 09:43
User Agent detection in Java
/* *******************************************
// LICENSE INFORMATION
// The code, "Detecting Smartphones Using PHP"
// by Anthony Hand, is licensed under a Creative Commons
// Attribution 3.0 United States License.
//
// Updated 01 March 2010 by Bryan J Swift
// - Remove un-needed if statements instead just returning the boolean
// inside the if clause
//
@swallat
swallat / DarkMonokai.css
Last active May 7, 2024 11:29 — forked from Zren/DarkMonokai.qss
Dark Monokai - Quassel Theme (qss)
/**
** ____ _ ___ ___ _ _
** | _ \ | | | \/ | | | (_)
** | | \ |__ _ _ __| | __ | . . | ___ _ __ ___ | | __ __ _ _
** | | | | _` | '__| |/ / | |\/| |/ _ \| '_ \ / _ \| |/ // _` | |
** | |_/ /(_| | | | < | | | | (_) | | | | (_) | <| (_| | |
** |____/\__,_|_| |_|\_\ \_| |_/\___/|_| |_|\___/|_|\_\\__,_|_|
**
** Quassel Theme
**
@xyuanmu
xyuanmu / qqMusicSign.py
Last active May 7, 2024 11:27
Python版QQ音乐sign加密
#encoding = utf-8
import re
import base64
from hashlib import md5
headMap = [21, 4, 9, 26, 16, 20, 27, 30]
middleMap = [212, 45, 80, 68, 195, 163, 163, 203, 157, 220, 254, 91, 204, 79, 104, 6]
tailMap = [18, 11, 3, 2, 1, 7, 6, 25]
def sign(data):