Skip to content

Instantly share code, notes, and snippets.

@kitak
kitak / memo.md
Created September 12, 2016 02:56
HLS、mp4まわりのメモ

ts を mp4 に変換する( http://www.sonota.trance-cat.com/ffmpeg%E3%82%92%E5%88%A9%E7%94%A8%E3%81%97%E3%81%A6ts%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%92mp4%E3%81%AB%E5%A4%89%E6%8F%9B%E3%81%99%E3%82%8B/ )

ffmpeg -i 720.00012.ts -b:v 3000k -acodec ac3 -ar 48000 -threads 4 -vcodec libx264 720.00011.mp4

変換した後にファイルのリストを用意して、再び、ts & m3u8 へ。思った通りの秒数で区切ってくれない(rとかgの指定の関係?)。けっこう時間がかかる。 参考にしたとこ。( http://stackoverflow.com/questions/29180665/ffmpeg-segmentation-with-multiple-mp4-files-to-hls-stream )

file 720.00011.mp4
@kitak
kitak / python.md
Last active September 19, 2016 12:53
pythonの作業環境メモ
  • virtualenvをつくる
    • virtualenv venv
  • Pythonのバージョンを指定してvirtualenvをつくる
    • virtualenv -p /usr/local/bin/python2 venv2
  • pipはvirtualenvがつくるときにinstallされるからそれ使う
  • source venv/bin/activate で環境を有効にする
  • activeしなくても、venv/bin のコマンドを直接叩けばvirtualenvの閉じた環境で実行できる
  • pipでインストールされた内容(依存しているパッケージも含む)は、pip freeze --allで分かる
    • それを pip freeze --all > requirements.txt みたいなかんじでファイルに書き出して
  • pip install -r requirements.txt で同じ内容をインストールできる
@kitak
kitak / gist:22659fdeade6534f6a7da0186146f47f
Created September 3, 2016 07:56
html5 conference めも
# Service Worker Deep Dive
- goo.gl/YxL2L7
- GCMからFCMに変わった
- pushにペイロードのっけれるようになったよ
- node.js用のライブラリもあるよ
- Standard Web Push Protocol
* VAPID(標準化されたプロトコル)でPush通知ができるようになった
- foreign fetch(実験中の機能)
* 別オリジンでも横取りできる?
* imgタグとかで表示はできるけど、JSでは読めない
function noop() {}
const fakeLogger = {
trace: noop,
debug: noop,
log: noop,
warn: noop,
info: noop,
error: noop
};
@kitak
kitak / editing
Last active August 2, 2016 11:56
perl -i.bak -wpl -e 's/RE/replacement/g;' *.html
@kitak
kitak / sample.js
Last active June 21, 2016 15:38
Nashorn's bug with using `with` statement
function Foo() {
this.bar = "bar";
this.baz = "baz";
}
Foo.prototype._h = function(str) {
print("expect `bar`: " + this.bar);
}
Foo.prototype._e = function() {
@kitak
kitak / index.js
Last active April 4, 2016 13:36
nashornサンプル(excelのシート参照)
var XSSFWorkbook = Java.type("org.apache.poi.xssf.usermodel.XSSFWorkbook");
var FileInputStream = Packages.java.io.FileInputStream;
var FileOutputStream = Packages.java.io.FileOutputStream;
var OutputStreamWriter = Packages.java.io.OutputStreamWriter;
var stream = new FileInputStream("./list.xlsx");
var workbook = new XSSFWorkbook(stream);
var sheet = workbook.getSheetAt(0);
var numberOfRows = sheet.getPhysicalNumberOfRows();
arrow-parens 2
arrow-spacing 2
constructor-super 2
no-arrow-condition 2
no-class-assign 2
no-const-assign 2
no-dupe-class-members 2
no-this-before-super 2
no-var 2
object-shorthand 2 (thisの挙動きになる)
function sleep(seconds) {
var end = Date.now() + 1000 * seconds;
var now = Date.now();
while (now < end) { now = Date.now(); }
return;
}
@kitak
kitak / entry.md
Last active August 29, 2015 14:05
RubyHiroba 生活発表会 申し込み

お名前(Name)

喜多啓介 @kitak

自己紹介(bio, your introduction)

GMOペパボ株式会社 の EC事業部カラーミーショップグループWEB開発チームに所属しているエンジニア。
SUZURIという画像をアップロードするだけでオリジナルグッズを作成・販売できるサービスを担当しています。

発表タイトル(talk title)

Railsのコードで特別対応をよしなにやる話