Skip to content

Instantly share code, notes, and snippets.

ffmpeg -i $1 -c copy -map 0 -segment_time 3600 -f segment -strftime 1 "$2/%Y-%m-%d_%H-%M-%S.mkv"
(function($) {
var baseUrl = "https://www.lego.com//service/biservice/searchbytheme?fromIndex={index}&onlyAlternatives=false&theme={theme}"
var themes = JSON.parse($("div.product-search").attr("data-search-themes"))
var products = []
next = function() {
if (themes.length) {
theme = themes.pop()
dowload(0, theme.key, theme.Label)
(function($) {
t = null
checkResult = function(coupon, coupons) {
let msg = $("#allcoupon_msg").text()
if (msg == "") {
t = setTimeout(checkResult, 500, coupon, coupons)
console.log(coupon + " wait for 500ms")
} else {
$("#allcoupon_msg").html("")
@brianpow
brianpow / bookmarklet-taobao-dump.js
Created September 28, 2017 15:33
A snippet to dump the order history from taobao.com. Please jQuerify the page first.
(function($) {
parse = function(data, textStatus, jqXHR) {
console.log(data)
orders = data.mainOrders
rows = []
for (let mOrder of orders) {
header = []
body = []
header = [mOrder.id,
//For https://www.dpreview.com/products/search/cameras
(function($) {
var all = []
var parse = function() {
$("td.info").each(function() {
all.push([
$("div.name", this).text(),
$("div.announcementDate", this).text(),
$("div.prices", this).text(),
].concat($("div.shortProductSpecs", this).text().split("|")).join("\t"))
//https://www.mchk.org.hk/english/list_register/list.php?&type=L
(function($) {
var parse = function($$) {
return $$.find("table[cellpadding=4] tr").map(function(i) {
if (i === 0) return ""
let $td = $("td", this)
let data;
if ($td.eq(0).attr("headers") === "qualification") {
data = ["", "", "", "", "",
$td.eq(0).find("span:eq(0)").get(0).childNodes[0].data,
@brianpow
brianpow / bookmarklet-price.com.hk-parser.js
Last active October 3, 2017 15:16
Create a textarea with price and product details in tab-separated format in current category of www.price.com.hk
(function($) {
var parse = function($$) {
console.log("parse")
var brands = $$.find("select[name=brand] option").map(function() {
return this.value
}).get() || []
brands.shift()
var category = $$.find("div.nav-menu").text().trim()