Skip to content

Instantly share code, notes, and snippets.

View soshial's full-sized avatar
🏠
Working from home

soshial

🏠
Working from home
View GitHub Profile
@waiting-for-dev
waiting-for-dev / merge2ass.sh
Last active October 16, 2018 16:19
Script to run mplayer with two subtitles tracks at the same time. Usage: mplayer2 video sub1 sub2. merge2ass.sh (http://www.abclinuxu.cz/blog/Joseho_blog/2007/7/30/188299) script must be in the path.
#!/bin/bash
# merge2ass.sh - script for merging two text-subtitles into an ass subtitle file
# version 0.9b, 02-feb-2013
# comments/criticism/praise to jose1711-gmail-com
# dependencies: mplayer (if your subtitle files need to be converted to srt), gnu utils
# thanks to:
# - d.watzke for comments
# - belisarivs for testing
@josephg
josephg / 0dedict.py
Last active February 16, 2024 08:33
Apple dictionaries
# Thanks to commenters for providing the base of this much nicer implementation!
# Save and run with $ python 0dedict.py
# You may need to hunt down the dictionary files yourself and change the awful path string below.
# This works for me on MacOS 10.14 Mohave
from struct import unpack
from zlib import decompress
import re
filename = '/System/Library/Assets/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/9f5862030e8f00af171924ebbc23ebfd6e91af78.asset/AssetData/Oxford Dictionary of English.dictionary/Contents/Resources/Body.data'
f = open(filename, 'rb')
@wojteklu
wojteklu / clean_code.md
Last active April 24, 2024 00:28
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@barbeau
barbeau / Dual-frequency GNSS on Android.csv
Last active July 11, 2019 18:11
Dual-frequency GNSS on Android
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Deprecated in favor of direct view of Google Sheet (https://docs.google.com/spreadsheets/d/1z6Yt9c4cyev1PB6VWEkbZtJGfoxAQ5UJnHyP24sFwlk/edit#gid=0) in Medium article (https://medium.com/@sjbarbeau/tl-dr-dual-frequency-gnss-on-android-table-of-devices-9be4bbb83a7b) using Sheetsu.