Skip to content

Instantly share code, notes, and snippets.

View suen427's full-sized avatar
🌴
On vacation

孙华 suen427

🌴
On vacation
View GitHub Profile
@suen427
suen427 / listen1_aha_playlist.md
Last active December 4, 2018 15:45
updated by Listen1(http://listen1.github.io/listen1/) at 2018/12/4 下午11:46:03

本歌单由Listen1创建, 歌曲数:275,歌单数:3,点击查看更多

@suen427
suen427 / querySelector.polyfill.js
Created September 8, 2018 08:59 — forked from chrisl8888/querySelector.polyfill.js
IE document.querySelector() polyfill
if (!document.querySelectorAll) {
document.querySelectorAll = function (selectors) {
var style = document.createElement('style'), elements = [], element;
document.documentElement.firstChild.appendChild(style);
document._qsa = [];
style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}';
window.scrollBy(0, 0);
style.parentNode.removeChild(style);
@suen427
suen427 / video.sh
Last active August 22, 2018 06:45
ffmpeg command
# move moov to the mp4 file begin
ffmpeg -i input.mp4 -movflags faststart -acodec copy -vcodec copy output.mp4
# convert video for HLS
ffmpeg -i input.mp4 -profile:v baseline -level 3.0 -s 640x360 -start_number 0 -hls_time 10 -hls_list_size 0 -f hls index.m3u8
ffmpeg -i in.mkv -c:v h264 -flags +cgop -g 30 -hls_time 1 out.m3u8
ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
-map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \
-hls_segment_filename 'file_%v_%03d.ts' out_%v.m3u8
@suen427
suen427 / xor.py
Created August 9, 2018 07:50 — forked from stewartpark/xor.py
Simple XOR learning with keras
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimizers import SGD
import numpy as np
X = np.array([[0,0],[0,1],[1,0],[1,1]])
y = np.array([[0],[1],[1],[0]])
model = Sequential()
model.add(Dense(8, input_dim=2))
@suen427
suen427 / objectToJsonFunction.ftl
Created July 6, 2017 08:30
freemarker object convert to jsonstring
<#function objectToJsonFunction object>
<#local json = "">
<#if object?is_hash || object?is_hash_ex>
<#local first="true">
<#local json = json + '{'>
<#list object?keys as key>
<#if first="false"><#local json = json + ','></#if>
<#local value = objectToJsonFunction(object[key]) >
<#local json = json + '"${key}": ${value?trim}'>
<#local first="false">
http://wpa.qq.com/msgrd?v=3&uin=729219964&site=qq&menu=yes
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://play.baidu.com/*
// @grant none
// ==/UserScript==
@suen427
suen427 / gulpfile.js
Last active April 26, 2016 09:19
gulp配置文件
var gulp = require('gulp'),
cleanCSS = require('gulp-clean-css'),
sourcemaps = require('gulp-sourcemaps'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
rename = require("gulp-rename"),
notify = require("gulp-notify"),
imagemin = require('gulp-imagemin'),
clean = require('gulp-clean'),