django 関連
- django
- django-classy-tags
import datetime | |
def get_last_sunday(dt: datetime.datetime) -> datetime.datetime: | |
""" | |
ある時刻が与えられたとき、その時刻を前回の日曜の15時に変換する | |
>>> get_last_sunday(datetime.datetime(2022, 12, 13, 2, tzinfo=datetime.timezone.utc)) | |
datetime.datetime(2022, 12, 11, 15, 0, tzinfo=datetime.timezone.utc) | |
>>> get_last_sunday(datetime.datetime(2022, 12, 18, 14, 0, tzinfo=datetime.timezone.utc)) |
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) |
import re | |
import operator | |
import json | |
import requests | |
import lxml.etree | |
import lxml.html | |
def collect_global_vars(doc): |
#!/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 |
$ 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 |
cppan https://cppan.org/client/
cmake https://cmake.org/download/
Visual Studio Community 2017
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 |
# 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 |
$ 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) |