Skip to content

Instantly share code, notes, and snippets.

View temberature's full-sized avatar

Tong temberature

  • USA
View GitHub Profile
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
src="/volume1/homes/1605259395"
dst="/volume1/books"
echo $src
function read_dir() {
for file in $(#
ls $1
idlePrefetch (originImageUrl) {
let fetched = false;
let myNonEssentialWork = deadline => {
const appendLinkTo = function (url) {
const linkTag = document.createElement('link')
linkTag.rel = 'prefetch'
linkTag.href = url
document.head.appendChild(linkTag)
}
if (deadline.timeRemaining() > 0) {
@temberature
temberature / gist:4f986ef049f938a3402784026d9deea7
Last active July 3, 2019 07:00
JS 选择所有包含某个字符的 id
document.querySelectorAll('[id*=block]')
Array.apply(null, document.querySelectorAll('[id]')).map(item => item.getAttribute('id')).filter(item => item.includes('block'))
@temberature
temberature / removeB.js
Created April 12, 2019 09:28
replace <b>text</b> with text
document.querySelectorAll('b').forEach(element=>{
// element.parentNode.replaceChild(document.createTextNode(element.innerText), element)
console.log(element)
if (element.parentNode && element.parentNode.innerText) {
element.parentNode.innerHTML = element.parentNode.innerText
}
}
)
{
"name": "New Project",
"lastSyncedAt": "2019-03-28T07:51:57.386Z",
"markers": [],
"tracks": [],
"version": 13,
"shouldCloudSync": false,
"updatedAt": "2019-03-28T07:55:23.935Z",
"schemaVersion": 8,
"aspectRatio": "16:9",
{
"local": [
{
"asset_path": null,
"name": null,
"asset_size": 19932335,
"tags": [],
"created_at": "2019-03-28T07:55:27.049620",
"updated_at": "2019-03-28T07:55:27.049628",
"s3_bucket_name": null,
{
"id": "8f1a9f7f-64b6-4c43-9bd5-948101d055fc",
"name": "New Project",
"aspectRatio": "16:9",
"markers": [],
"version": 10,
"schemaVersion": 8,
"shouldCloudSync": false,
"createdAt": "2019-03-12T03:59:16.662Z",
"updatedAt": "2019-03-28T07:41:16.659Z",
@temberature
temberature / index.html
Created March 21, 2019 12:43
ffmpeg wasm
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
var fs = require('fs');
var path = require('path');
var OpenCC = require('opencc');
// Load the default Simplified to Traditional config
var opencc = new OpenCC('t2s.json');
// Sync API
var converted = opencc.convertSync("漢字");
console.log(converted);
#!/bin/sh
# bash tut: http://linuxconfig.org/bash-scripting-tutorial
# Linux PDF,OCR: http://blog.konradvoelkel.de/2013/03/scan-to-pdfa/
y="$(pwd)/$1"
echo Will create a searchable PDF for $y
x="$(basename "$y")"
name=${x%.*}