Skip to content

Instantly share code, notes, and snippets.

View larvata's full-sized avatar

Larvata larvata

View GitHub Profile
@larvata
larvata / shadowsocks-quota
Last active October 14, 2023 16:06
shadowsocks bandwidth limit and data quota each port
# draft
# view current data quota
sudo iptables -nvL -t filter --line-numbers
# init
sudo iptables -I OUTPUT -p tcp --sport <target-port> -m quota --quota <quota-bytes> -j ACCEPT
sudo iptables -I OUTPUT -p tcp --sport <target-port> -j DROP
# reset quota
@larvata
larvata / download-playboy.js
Last active February 6, 2023 03:57
bookmarklet for saving 週プレ images
// using online bookmarklet tools
// https://www.yourjs.com/bookmarklet/
function createButton(label) {
const btn = document.createElement('button');
btn.innerHTML = label;
btn.style.fontSize = '50px';
btn.style.position = 'absolution';
btn.style.top = 0;
btn.style.marginTop = '100px';

ffmpeg Cheatsheet

  • Join TS Files
  • Convert TS to MP4
  • Download Online AES-128 Encrypted HLS video
  • Convert Video to GIF
  • Extract Audio and Convert it to MP3
  • Burn Subtitles into Video

Join TS Files

@larvata
larvata / SMBDIS.ASM
Created October 28, 2019 01:20 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
// ==UserScript==
// @name instagram easy save
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.instagram.com/
// @grant none
// ==/UserScript==
@larvata
larvata / tampermonkey-twitter-full-image.js
Last active March 15, 2018 07:27
twitter full size image
// ==UserScript==
// @name twitter full size image
// @namespace https://github.com/larvata
// @version 0.3
// @description always get the hi-res image from twitter
// @author Larvata
// @match https://pbs.twimg.com/*
// @grant none
// @license MIT
// ==/UserScript==
@larvata
larvata / index.js
Last active February 7, 2018 10:12
dump pages from zasshi-online.com
const fs = require('fs');
const requestDefault = require('request');
const curlParser = require('parse-curl');
const Jimp = require('jimp');
const jar = requestDefault.jar();
const request = requestDefault.defaults({ jar });
const requestPromise = (requestOption) => new Promise((resolve, reject) => {
request(requestOption, (err, res) => {
@larvata
larvata / SmartVirtualList.js
Created November 23, 2017 03:08
an infinite scroll component which didn't require the item height
import React from 'react';
import ReactDOM from 'react-dom';
import _ from 'lodash';
// todos
// - move the ref of each item componnent to it's parent
// - check the SSR result, because the actual content only rendered after did mount
// d - is set containerDOM.style.height in did update necessary?
// d - rename padding elements to beforePadder, afterPadder
// - set the buffer height to the height of container by default
@larvata
larvata / JUST-DICE-2.js
Last active June 24, 2017 03:29
auto script for just-dice with new feature
// ==UserScript==
// @name JUST-DICE
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description enter something useful
// @match https://just-dice.com/*
// @copyright 2012+, You
// ==/UserScript==
///////// CONST /////////