Skip to content

Instantly share code, notes, and snippets.

View robinfang's full-sized avatar
🐌
人都麻了

robinfang robinfang

🐌
人都麻了
View GitHub Profile
ffmpeg -hwaccel cuvid -i in.MP4 -c:v h264_nvenc -c:a copy -crf 28 out.mp4
@robinfang
robinfang / jiagebaohu.js
Last active March 15, 2020 15:10
京东价格保护页面点击全部按钮
$x('//div[@class="btn"]/a').forEach((el,i)=>{
setTimeout( ()=>{
el.click()
}, i*3000 );
})
class LSTMCell(Layer):
"""Cell class for the LSTM layer.
# Arguments
units: Positive integer, dimensionality of the output space.
activation: Activation function to use
(see [activations](../activations.md)).
Default: hyperbolic tangent (`tanh`).
If you pass `None`, no activation is applied
(ie. "linear" activation: `a(x) = x`).
recurrent_activation: Activation function to use
\copy allcountrydata(geonameid,name,asciiname,alternatenames,latitude,longitude,feature_class,feature_code,country_code,cc2,admin1_code,admin2_code,admin3_code,admin4_code,population,elevation,dem,timezone,modification_date) from '/Users/fang/workspace/geonameworkspace/GeoNames-MySQL-DataImport/data/allCountries.txt' DELIMITERS E'\t' CSV QUOTE E'\b' NULL AS '';
for x in c_resources:
if "url" in dir(x.store):
r.append(x.store.url)
elif "connection_parameters" in dir(x.store):
r.append(x.store.connection_parameters['url'])
#coding=utf8
import os
import sys
def copyStructure(inpath,outpath):
for dirpath, dirnames, filenames in os.walk(inpath):
print("walking, outpath {}, dirpath {}".format(outpath, dirpath))
structure = os.path.join(outpath, os.path.relpath(dirpath, inpath))
if not os.path.isdir(structure):
print("mkdir: {}".format(structure))
os.mkdir(structure)
@robinfang
robinfang / howhot_init.lua
Created July 28, 2019 10:50
nodemcu+dht22测温度
function getdht()
status, temp, humi, temp_dec, humi_dec = dht.read(4)
if status == dht.OK then
print("temperature=" .. (temp) .. ", humidity=" .. (humi) .. "")
-- send message
msg = "温度" .. (temp) .. ",湿度" .. (humi) .. ""
elseif status == dht.ERROR_CHECKSUM then
print("DHT Checksum error.")
elseif status == dht.ERROR_TIMEOUT then
print("DHT timed out.")
ffmpeg -i "$1" -ab 320k "${1%.*}.mp3"
@robinfang
robinfang / png2jpg.sh
Created September 14, 2018 14:42
convert png to jpg using sips
for i in *.png; do sips -s formatOptions 95 -s format jpeg "$i" --out ../binganout/"${i%png}".jpg;done
@robinfang
robinfang / parse_sms.py
Created April 22, 2018 16:19
解析windows phone备份的短信,可存入sqlite
# coding=utf-8
import sqlite3
import xml.etree.ElementTree
from datetime import datetime
from datetime import timedelta
import pdb
EPOCH_AS_FILETIME = 116444736000000000