Skip to content

Instantly share code, notes, and snippets.

@s25g5d4
s25g5d4 / iframe-probe.py
Last active May 18, 2023 07:01 — forked from ragnraok/iframe-probe.py
Shows GOP structure for video file using ffmpeg --show-frames output
#!/usr/bin/env python
#
# Shows GOP structure of video file. Useful for checking suitability for HLS and DASH packaging.
# Example:
#
# $ iframe-probe.py myvideo.mp4
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
#!/bin/bash
#
# This is a rather minimal example Argbash potential
# Example taken from http://argbash.readthedocs.io/en/stable/example.html
#
# ARG_OPTIONAL_SINGLE([start],[s],[start time])
# ARG_OPTIONAL_SINGLE([to],[t],[end time])
# ARG_OPTIONAL_SINGLE([frame-rate],[r],[set frame rate (Hz value, fraction or abbreviation)],[10])
# ARG_OPTIONAL_BOOLEAN([palette],[],[build custom palette],[on])
# ARG_OPTIONAL_BOOLEAN([override],[y],[override output files without asking])
@s25g5d4
s25g5d4 / flac2alac
Created September 20, 2019 08:25
Convert flac to alac.
#!/bin/bash
function flac2alac {
filename=$(basename "$1" .flac)
dir=$(dirname "$1")
artformat="$(metaflac --export-picture-to=- "$1" | file --mime --brief - | awk '{split($1,arr,";"); print arr[1]}')"
artfile=".art.${filename}"
echo "Convert $1 ..."
@s25g5d4
s25g5d4 / thsr-ticket.user.js
Created January 16, 2018 16:07
高鐵搶票自動填入ㄏㄏ
// ==UserScript==
// @name THSR Ticket
// @namespace Violentmonkey Scripts
// @include https://irs.thsrc.com.tw/IMINT
// @include https://irs.thsrc.com.tw/IMINT/*
// @run-at document-idle
// @grant none
// @version 1.0
// ==/UserScript==
//
class Queue {
constructor(limit, ...options) {
let timeout, delay;
if (options.length) {
if (typeof options[0] === 'object') {
({timeout, delay} = options[0]);
}
else {
[timeout, delay] = options;
}
# -*- encoding: utf-8 -*-
from libpydhcpserver.dhcp import DHCPServer
class MyDhcpd(DHCPServer):
def _handleDHCPDecline(self, packet, source_address, port):
print 'Get Message, Type: {msgtype}, HW Address: {hwaddr}'.format(
msgtype=packet.getDHCPMessageTypeName(),
hwaddr=packet.getHardwareAddress()
)
class Queue {
constructor(limit, timeout = 0) {
this.limit = limit;
this.timeout = timeout;
this.slot = [];
this.q = [];
}
queue(asyncFunc, name) {
let _self = this;
$ cat ./test
#!/bin/bash
echo "a
b
3
4
-1
-2
c
<?php
$user=$_GET["user"];
$myname=$user;
?>
<html>
<body>
<div align="center">
<span>
Welcome! This is SECURE PROGRAMMING Shopping Mall
</span>
@s25g5d4
s25g5d4 / FUCK-NSYSU.js
Created August 11, 2015 12:08
NO 問卷
[].slice.call(document.querySelectorAll('.QTitle + td table td:nth-child(3) label'), 0).forEach(function (e) { e.click(); });