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 / app.js
Created November 28, 2011 07:14
node.js / socket.io SSL接続サンプル (サーバ, クライアント)
var PORT = 10443;
var SSL_KEY = '___.key';
var SSL_CERT= '___.cert';
var fs = require('fs');
var io = require('socket.io').listen(PORT, {
key : fs.readFileSync(SSL_KEY).toString(),
cert : fs.readFileSync(SSL_CERT).toString()
});
@kanreisa
kanreisa / gist:923898
Created April 17, 2011 09:48
ffcopy - 動画ファイルのヘッダを修復する用
#!/bin/sh
ffmpeg -i $1 -vcodec copy -acodec copy ffcopy_$1
rm $1
mv ffcopy_$1 $1
PS C:\WINDOWS\system32> coreinfo
Coreinfo v3.31 - Dump information on system CPU and memory topology
Copyright (C) 2008-2014 Mark Russinovich
Sysinternals - www.sysinternals.com
AMD Ryzen 7 1700X Eight-Core Processor
AMD64 Family 23 Model 1 Stepping 1, AuthenticAMD
Microcode signature: 0800110E
HTT * Multicore
========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)
System: ubuntu: GNU/Linux
OS: GNU/Linux -- 4.8.0-22-generic -- #24-Ubuntu SMP Sat Oct 8 09:15:00 UTC 2016
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: AMD Ryzen 7 1700X Eight-Core Processor (6786.9 bogomips)
Hyper-Threading, x86-64, MMX, AMD MMX, Physical Address Ext, SYSENTER/SYSEXIT, AMD virtualization, SYSCALL/SYSRET
CPU 1: AMD Ryzen 7 1700X Eight-Core Processor (6786.9 bogomips)
"use strict";
const http = require("http");
const MongoClient = require('mongodb').MongoClient;
let collection = null;
let documentId = null;
MongoClient.connect("mongodb://user:pass@hostname:port/dbName", (err, db) => {
"use strict";
const http = require("http");
const DocumentClient = require('documentdb-q-promises').DocumentClientWrapper;
const host = "https://<name>.documents.azure.com:443/";// Add your endpoint
const masterKey = "...";// Add the masterkey of the endpoint
const client = new DocumentClient(host, { masterKey: masterKey });
// DB, Collection, Document 生成コードは面倒なので省きました。
@kanreisa
kanreisa / basic.css
Created April 13, 2016 07:33
Electron を光らせる
div#container {
-webkit-user-select: none;
-webkit-app-region: drag;
position: absolute;
top: 10px;
right: 10px;
bottom: 10px;
left: 10px;
background: #fff;
box-shadow: 0 0 10px rgba(0,0,0,0.15);
@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