Skip to content

Instantly share code, notes, and snippets.

View get_timedtext.js
const fetch = require('node-fetch')
const { JSDOM } = require('jsdom')
const nodeEval = require('node-eval')
const xmlParser = require('fast-xml-parser')
const DEFAULT_LANG = 'ja'
function extractTracksFromHTML(body) {
const dom = new JSDOM(body)
View get_timedtext.py
import re
import operator
import json
import requests
import lxml.etree
import lxml.html
def collect_global_vars(doc):
View mysql_dump_all_db.sh
#!/bin/sh
set -eu
SELECT_SCHEMA_SQL=<<EOF
SELECT SCHEMA_NAME FROM information_schema.SCHEMATA
WHERE SCHEMA_NAME NOT IN ("information_schema", "performance_schema");
EOF
mysql -u root -N -e "${SELECT_SCHEMA_SQL}" | while read dbname; do
View index.md

django-cms ライブラリ調査資料

Chapter. 1 使用ライブラリ調査

1-1. django-cms を djangocms-installer でインストールした場合にインストールされるライブラリ一覧

django 関連

  • django
  • django-classy-tags
View bench_unroll.txt
$ go version
go version go1.12.5 darwin/amd64
$ go test -bench .
goos: darwin
goarch: amd64
BenchmarkContainsUint64-4 500000 2286 ns/op
BenchmarkContainsUint64Unroll2-4 1000000 1988 ns/op
BenchmarkContainsUint64Unroll4-4 1000000 1589 ns/op
BenchmarkContainsUint64Unroll8-4 1000000 1795 ns/op
PASS
@knzm
knzm / 00-README.md
Last active Jul 20, 2019
build tesserocr for Python 2.7 on Windows
View 00-README.md
@knzm
knzm / gist:149fdda292a03caa7a49498bcff4fdb2
Created May 4, 2019
Fix firefox's disabled extensions related to the certificate issue occured at May 4, 2019
View gist:149fdda292a03caa7a49498bcff4fdb2
cd ~/Library/Application Support/Firefox/Profiles/<profile folder>
mv extensions.json extensions.json-20190504
cat extensions.json-20190504 | jq '(.addons[] | select(.signedState == -1)) |= (.signedState = 1 | .active = true | .appDisabled = false)' > extensions.json
@knzm
knzm / gist:6447ffb745e21d97d16ff3460935d095
Last active Mar 12, 2019
Replace style.css in Jasper.app to fix broken layout
View gist:6447ffb745e21d97d16ff3460935d095
# install asar
npm install -g asar
# extract, patch, then pack
mkdir out
asar extract /Applications/Jasper.app/Contents/Resources/app.asar out/
cd out
curl -s https://patch-diff.githubusercontent.com/raw/jasperapp/jasper/pull/85.diff | patch -p1
cd ..
asar pack out app.asar
View gist:fca0a824178f0dd1ebff247e01c7c412
$ VIRTUALENV_VERSION=16.2.0 virtualenv .
Traceback (most recent call last):
File "/usr/bin/virtualenv", line 11, in <module>
sys.exit(main())
File "/usr/lib/python2.7/site-packages/virtualenv.py", line 704, in main
options, args = parser.parse_args()
File "/usr/lib/python2.7/optparse.py", line 1384, in parse_args
values = self.get_default_values()
File "/usr/lib/python2.7/site-packages/virtualenv.py", line 579, in get_default_values
return optparse.Values(defaults)
View example_pool_with_interrupt.go
package main
import (
"errors"
"fmt"
"log"
"math/rand"
"sync"
"time"
)