Skip to content

Instantly share code, notes, and snippets.

View kanreisa's full-sized avatar
☑️
Busy

Yuki K. kanreisa

☑️
Busy
View GitHub Profile
@kanreisa
kanreisa / flagrate-test.js
Created July 1, 2014 08:37
Flagrate Test Support
var _Button = flagrate.Button;
flagrate.Button = function () {
var button = _Button.apply(this, arguments);
button.dataset.label = button._label.innerHTML;
button.dataset.color = button._color || '';
// async support
@kanreisa
kanreisa / flagrate.d.ts
Last active August 29, 2015 14:03
TypeScriptified Flagrate (working)
declare module Flagrate {
var className: string;
function identity<T>(a: T): T;
function extendObject<T, U>(b: T, a: U): T;
function emptyFunction(): void;
/**
* Json Pointer Implementation.
* @namespace Flagrate.jsonPointer
**/
module jsonPointer {
@kanreisa
kanreisa / index.js
Created May 21, 2014 06:16
maniaxcache/2
/*jslint node:true, nomen:true, plusplus:true, regexp:true, vars:true, continue:true */
'use strict';
var config = require('./config.json');
var dncs = config.dncs || [];
var dncsLength = dncs.length;
var util = require('util');
var http = require('http');
#!/bin/bash
EXT="mp4"
PTAG="x264_r14f18p"
ATAG="fdkaac_he96ab"
# m2ts -> m4a
avconv -y -i $1 -vn -map 0:a:0 \
-c:a libfdk_aac -profile:a aac_he -b:a 96k -afterburner 1 \
-f mp4 $1.tmp.m4a
@kanreisa
kanreisa / packet.js
Last active December 24, 2015 05:59
var packet = null;
var testStream = fs.createReadStream(__dirname + '/test.m2ts');
testStream.on('data', function (chunk) {
var i, l;
for (i = 0, l = chunk.length; i < l; i++) {
if (chunk[i] === 0x47 && (packet === null || packet.length >= 188)) {
@kanreisa
kanreisa / gist:5522683
Last active December 17, 2015 00:39
れいさ用 avconv (libav)
# x264
git clone git://git.videolan.org/x264.git /tmp/x264
cd /tmp/x264
./configure --prefix=/usr/local --enable-static --enable-shared
make -j 4
make install
# libav
@kanreisa
kanreisa / gist:5522174
Last active December 17, 2015 00:38
5.1ch
ffmpeg -i input.dts -acodec pcm_s16le -ar 48000 -ac 6 -f wav pipe: | faac -q 128 -w - -o output.m4a
ffmpeg -i input.wav -acodec libfaac -aq 128 -f mp4 output.m4a
avconv -i input.wav -c:a libfdk_aac -flags +qscale -global_quality 5 -afterburner 1 -f mp4 output.m4a
@kanreisa
kanreisa / gist:4970160
Created February 17, 2013 04:31
WARNING: at /build/buildd-linux-2.6_2.6.32-45-amd64-FcX7RM/linux-2.6-2.6.32/debian/build/source_amd64_none/net/sched /sch_generic.c:261 dev_watchdog+0xe2/0x194()
Feb 17 10:36:01 yui kernel: [1275074.404755] ------------[ cut here ]------------
Feb 17 10:36:01 yui kernel: [1275074.404766] WARNING: at /build/buildd-linux-2.6_2.6.32-45-amd64-FcX7RM/linux-2.6-2.6.32/debian/build/source_amd64_none/net/sched
/sch_generic.c:261 dev_watchdog+0xe2/0x194()
Feb 17 10:36:01 yui kernel: [1275074.404770] Hardware name: System Product Name
Feb 17 10:36:01 yui kernel: [1275074.404772] NETDEV WATCHDOG: eth0 (r8169): transmit queue 0 timed out
Feb 17 10:36:01 yui kernel: [1275074.404774] Modules linked in: usbhid hid ip6table_filter ip6_tables ebtable_nat ebtables cpufreq_userspace cpufreq_conservative
cpufreq_stats cpufreq_powersave kvm_intel kvm fuse nfsd exportfs nfs lockd fscache nfs_acl auth_rpcgss sunrpc tun bridge stp ipt_MASQUERADE iptable_filter ext4
jbd2 crc16 acpi_cpufreq iptable_nat ip_tables nf_nat x_tables nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 ib_ipoib ib_cm ib_sa inet_lro ib_uverbs ib_umad loop
tbsfe ir_lirc_codec lirc_dev ir_mce_kbd_decoder rc_tbs_nec ir_sony_d
// 一番最初に実行する
window.sessionStorage.setItem('total', 0);
// ♪ここから
// load
var total = parseInt(window.sessionStorage.getItem('total'), 10);
// totaling
total += (function () {
#!/bin/bash
ENCODER="HandBrakeCLI"
EXT="mp4"
VERSION="r11f18"
OUTPUT="$1_$VERSION.$EXT"
OPTS='-t 1 -c 1 -f mp4 --denoise="2:1.5:3:2.25" \
-w 1280 -l 720 --crop 0:8:0:0 --modulus 2 -e x264 -q 18 \