Skip to content

Instantly share code, notes, and snippets.

@mraaroncruz
mraaroncruz / steps.md
Last active Sep 10, 2021
Get the Telegram channel ID
View steps.md

To get the channel id

  1. Create your bot with botfather
  2. Make you bot an admin of your channel

New improved next steps

  1. Go to https://web.telegram.org
  2. Click on your channel
  3. Look at the URL and find the part that looks like c12112121212_17878787878787878
  4. Remove the underscore and after c12112121212
View anki2-change-defaultLang-to-en.py
#!/usr/bin/env python
# An `ad-hoc` script to change user interface language
# for Anki2 on Ubuntu 12.04 desktop.
# Usage: anki2-change-defaultLang-to-en.py [lang]
#
# Examples:
# # Change to english interface
# $ anki2-change-defaultLang-to-en.py en
@sartak
sartak / gist:3921255
Last active Aug 13, 2021
Anki 2 annotated schema
View gist:3921255
-- see https://github.com/ankidroid/Anki-Android/wiki/Database-Structure for a more maintained version of this
-- cards are what you review. easy!
CREATE TABLE cards (
id integer primary key,
-- the epoch milliseconds of when the card was created
nid integer not null,
-- notes.id
did integer not null,
-- deck id (available in col table)
@yellowled
yellowled / ffmpeg-html5
Created Dec 6, 2011
Convert videos to proper formats for HTML5 video on Linux shell using ffmpeg. Will probably convert this to a bash script later, but for the time being, here's some examples. Not sure there have actually sensible dimensions and bitrates for web video.
View ffmpeg-html5
# webm
ffmpeg -i IN -f webm -vcodec libvpx -acodec libvorbis -ab 128000 -crf 22 -s 640x360 OUT.webm
# mp4
ffmpeg -i IN -acodec aac -strict experimental -ac 2 -ab 128k -vcodec libx264 -vpre slow -f mp4 -crf 22 -s 640x360 OUT.mp4
# ogg (if you want to support older Firefox)
ffmpeg2theora IN -o OUT.ogv -x 640 -y 360 --videoquality 5 --audioquality 0 --frontend