Skip to content

Instantly share code, notes, and snippets.

@jayliew
jayliew / barcode_scanner_raspbian.py
Created March 22, 2018 22:32
USB barcode scanner read in Python on Raspberry Pi Raspbian
# Props to user brechmos for sharing the code here: https://www.raspberrypi.org/forums/viewtopic.php?t=55100
# Tested with the following barcode scanner
# macbook# ioreg -p IOUSB
# <snip>
# | +-o WIT 122-UFS V2.03@14200000 <class AppleUSBDevice, id 0x10000c3c4, registered, matched, active, busy 0 (6 ms), retain 14>
# WIT 122-UFS V2.03:
# Product ID: 0x1010
# Vendor ID: 0x05fe (CHIC TECHNOLOGY CORP)
@hnykda
hnykda / convert.py
Created February 21, 2018 21:26
Quick and dirty conversion of ZSH history into fish
# run as `python conver.py <path-to-your-zsh-history-file>
import sys
output_file = 'fish_converted_history'
zsh_history_file = sys.argv[1]
with open(zsh_history_file, 'r', errors='ignore') as ifile:
result = []
for cmd in ifile:
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@Realetive
Realetive / .vimrc
Last active July 20, 2018 23:10
NeoVim
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-sensible'
Plug 'altercation/vim-colors-solarized'
@Realetive
Realetive / install.sh
Created January 5, 2018 01:15
Как установить https://github.com/lyokha/vim-xkbswitch с Раскладкой Бирмана
# 1. Установить xkbswitch
git clone git@github.com:myshov/xkbswitch-macosx.git ~/.vim/plugin/xkbswitch-macosx
ln -s ~/.vim/plugin/xkbswitch-macosx/bin/xkbswitch /usr/local/bin/xkbswitch
# 2. Установить библиотеку-обёртку
git clone git@github.com:myshov/libxkbswitch-macosx.git ~/.vim/plugin/libxkbswitch-macosx
ln -s ~/.vim/plugin/libxkbswitch-macosx/bin/libxkbswitch.dylib /usr/local/lib/libxkbswitch.dylib
@jarun
jarun / fish_noti.md
Last active May 6, 2025 05:35
notification on command completion (fish shell)

Instead of waiting for long commands to finish one can easily get notifications when they are complete. The following procdure shows how to set his in fish shell.

Requirements: fish shell, notify-send, xdotool

  • Add a new file vi ~/.config/fish/functions/noti.fish with the content below:
function fish_right_prompt
    if test $CMD_DURATION
 # Check if terminal window is hidden
@OlesenkoViktor
OlesenkoViktor / PS3Dualshock_10_15.plist
Last active August 8, 2026 21:55
DualShock 3 + Mac OS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CGPDeviceCategory</key>
<string>GamePad</string>
<key>CGPDeviceType</key>
<string>PS3</string>
<key>CGPDisplayNameOvr</key>
<string>DualShock3 Analogue Triggers</string>
@umidjons
umidjons / youtube-dl-download-audio-only-on-best-quality.md
Last active March 31, 2026 18:26
Download Audio from YouTube with youtube-dl

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@emraher
emraher / custom.css
Created September 15, 2017 00:16
Vivaldi Custom CSS
/*==========================================================*/
/* qutebrowser-ish Vivaldi */
/*==========================================================*/
.mac #header {
min-height: 16px !important;
}
.mac #tabs-container.top {
padding-left: 0 !important;
padding-right: 0 !important;
}
@rmhsilva
rmhsilva / MacOS trackpad.md
Last active June 18, 2026 08:47
Accessing raw multitouch trackpad data (MacOS)