Skip to content

Instantly share code, notes, and snippets.

View tsukumijima's full-sized avatar
📺
DTV

tsukumi tsukumijima

📺
DTV
View GitHub Profile
@mikeconley
mikeconley / pip-captions.md
Last active March 17, 2022 21:19
Captions in Picture-in-Picture

Subtitle and caption support for many sites in Firefox's Picture-in-Picture player window is targeted to ship in Firefox 100.

Hi! If you're reading this, then you've asked me about or otherwise expressed interest in supporting captions / subtitles in Firefox's Picture-in-Picture feature.

As of this writing, Firefox does not currently support captions or subtitles in the player window. This is because most sites have invented their own mechanisms for display captions or subtitles. YouTube's captions, for example, are implemented in a completely different way from Netflix's.

This makes it rather difficult for us as a browser to develop a general solution to the subtitles / caption problem.

~Difficult, but not impossible. We're currently working on ways for us to develop site-specific behaviours for Picture-in-Picture. This allows Firefox's Picture-in-Picture feature to be smarter in how it interacts with specific video sites. In theory, this would allow us to detect the subtitles and captions and disp

@berkant
berkant / cloud-init.cfg
Last active September 24, 2025 01:37
Cloud-init config to set up my Ubuntu dev machine.
## template: jinja
#cloud-config
{% if v1.distro_release == 'focal' %}
users:
- name: berkant
shell: /usr/bin/bash
ssh_import_id: gh:berkant
sudo: ALL=(ALL:ALL) NOPASSWD:ALL
@zhuowei
zhuowei / WDBSetWebSecurityEnabled.m
Created September 1, 2020 04:47
Disable same-origin policy on iOS WKWebView with private API.
// Allows disabling Same-Origin Policy on iOS WKWebView.
// Tested on iOS 12.4.
// Uses private API; obviously can't be used on app store.
@import WebKit;
@import ObjectiveC;
void WKPreferencesSetWebSecurityEnabled(id, bool);
@interface WDBFakeWebKitPointer: NSObject
@igorbrigadir
igorbrigadir / BookmarkAPI_en.md
Created August 3, 2020 12:46 — forked from stepney141/BookmarkAPI_en.md
WIP: Twitter Undocumented Endpoints for Bookmark

Twitter Undocumented Bookmark API (WIP)

I found out the endpoints for bookmark with Chrome Developer Tools: GET timeline/bookmark, POST bookmark/entries/remove, POST bookmark/entries/remove. The rate limits below are values returned by an official endpoint GET application/rate_limit_status.

This document is still a work in progress because I got stuck in GET timeline/bookmark. Please let me know if you find how to use it.

Notes

  • It is necessary that x-csrf-token in a request header and ct0 in a cookie are the same value. Twitter uses them to avoid CSRF attacks. I recommend that you extract the values from your browsers.
  • All of the endpoints requires OAuth2 Authorizations. Note that they refuse OAuth2 Bearer tokens obtained from POST oauth2/token.
  • You can easily reach the rate limit and get HTTP 429 Error (too many requests), so you should be careful about how many requests you send.
@nyanshiba
nyanshiba / ffmpegtest.sh
Last active July 25, 2020 11:23
tsエンコ秘伝のタレ
# QSV H.264 LA-ICQ
ffmpeg -y -hide_banner -nostats -analyzeduration 30M -probesize 100M -fflags +discardcorrupt -i input.ts -strict -2 -c:a aac -b:a 256k -aac_coder twoloop -ac 2 -max_muxing_queue_size 4000 -vf bwdif=0:-1:1 -global_quality 25 -c:v h264_qsv -preset:v veryslow -g 300 -bf 6 -refs 4 -b_strategy 1 -look_ahead 1 -look_ahead_depth 60 -color_range tv -color_primaries bt709 -color_trc bt709 -colorspace bt709 -pix_fmt nv12 -map i:0x100 -map i:0x110 -movflags +faststart output.mp4
# NVEnc H.264 VBR_MinQP
ffmpeg -y -hide_banner -nostats -analyzeduration 30M -probesize 100M -fflags +discardcorrupt -i input.ts -strict -2 -c:a aac -b:a 256k -aac_coder twoloop -ac 2 -max_muxing_queue_size 4000 -vf bwdif=0:-1:1 -c:v h264_nvenc -preset:v slow -profile:v high -rc:v vbr_minqp -rc-lookahead 32 -spatial-aq 1 -aq-strength 1 -qmin:v 23 -qmax:v 25 -b:v 1500k -maxrate:v 3500k -pix_fmt yuv420p -map i:0x100 -map i:0x110 -movflags +faststart output.mp4
# NVEnc H.264 CQP
ffmpeg -y -hide_banner -nostats -analyzeduration
@AndroPlus-org
AndroPlus-org / userdata以外すべての場合
Last active October 11, 2025 02:20
Androidのイメージバックアップ (パスやファイル名は端末によって変わるため、適宜変更してください)
# 1. root権限で実行するためsuに
su
※suコマンドを実行できないGSIの場合は一旦exitでadb shellを抜けて以下を実行
adb root
adb shell
# 2. 各イメージがあるパスへ移動する (/dev/block/bootdevice/by-name/ の場合もあります)
cd /dev/block/by-name/
# 3. バックアップ保存用ディレクトリを作成
@mwufi
mwufi / install_docker_in_colab.sh
Last active November 10, 2025 23:30
Install Docker in Google Colab!
# First let's update all the packages to the latest ones with the following command
sudo apt update -qq
# Now we want to install some prerequisite packages which will let us use HTTPS over apt
sudo apt install apt-transport-https ca-certificates curl software-properties-common -qq
# After that we will add the GPG key for the official Docker repository to the system
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# We will add the Docker repository to our APT sources
@s3rj1k
s3rj1k / HowTo
Last active August 4, 2025 21:42
Ubuntu 20.04.3 AutoInstall
# For recent versions of Ubuntu:
- https://www.pugetsystems.com/labs/hpc/ubuntu-22-04-server-autoinstall-iso/
# Docs:
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/ConfigReference
- https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
- https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250/53
# Download ISO Installer:
@Connie-Wild
Connie-Wild / channels.yml
Last active October 7, 2025 05:30
mirakurun BSCSチャンネル設定(2025/09/01現在)
- name: NHK BS1
type: BS
channel: BS15_0
serviceId: 101
- name: BS日テレ
type: BS
channel: BS13_0
serviceId: 141
- name: BS朝日
type: BS
@thomd
thomd / workspace_utils.py
Last active July 30, 2023 21:53
Keeping Your Session Active in Google Colab
# The workspace_utils.py module includes an iterator wrapper called keep_awake and a context manager
# called active_session that can be used to maintain an active session during long-running processes.
# The two functions are equivalent, so use whichever fits better in your code.
#
# EXAMPLE 1
#
# from workspace_utils import keep_awake
# for i in keep_awake(range(5)): #anything that happens inside this loop will keep the workspace active
# # do iteration with lots of work here
#