Create React App does not provide watching build mode oficially (#1070).
This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.
Create a React app.
Put the script into scripts/watch.js
.
Create React App does not provide watching build mode oficially (#1070).
This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.
Create a React app.
Put the script into scripts/watch.js
.
! Swap Alt and Cmd keys. | |
keycode 37 = Control_L | |
keycode 133 = Alt_L Meta_L | |
keycode 64 = Super_L | |
keycode 108 = Super_R | |
keycode 134 = ISO_Level3_Shift Multi_key | |
keycode 105 = Control_R Multi_key | |
clear Shift | |
clear Lock | |
clear Control |
type TestType = { | |
key: string; | |
value: string; | |
} | |
export TestType; |
patch: | |
schema_list: | |
- schema: luna_pinyin_simp | |
- schema: emoji |
#!/usr/bin/env python | |
import os | |
import re | |
import praw | |
import requests | |
from datetime import datetime | |
from bs4 import BeautifulSoup | |
for sub in subs: | |
res = requests.get(sub.url) | |
if (res.status_code == 200 and 'content-type' in res.headers and |
// Remove null or undefine from array items | |
type NonNullableArray<T> = T extends Array<infer Item> ? Array<NonNullable<Item>> : never; |
# losslessly concat mp4 files | |
ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts | |
ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts | |
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4 | |
# concat files with the same format | |
# 1. create a file list | |
file '/path/to/file1' | |
file '/path/to/file2' | |
file '/path/to/file3' |
/** | |
* Draw string in the github contribution calendar. | |
* Usage: | |
* 1. Create a "snippet" in the Chrome devtool -> Sources -> Snippets (in left sidebar). | |
* 2. Visit your github profile page. | |
* 3. Modify the string. | |
* 4. Run | |
* | |
* Credit: | |
* - 3x5 font data: https://github.com/fabiopiratininga/oled-font-3x5 |
import sys | |
import pkgutil | |
import importlib | |
from .base import BaseCommand, CommandExecutor | |
def discover_commands(): | |
executor = CommandExecutor() | |
current_module = sys.modules[__name__] | |
__path__ = pkgutil.extend_path(current_module.__path__, __name__) |
def read_and_decode(filename_queue): | |
"""Read from tfrecords file and decode and normalize the image data.""" | |
reader = tf.TFRecordReader() | |
_, serialized_exmaple = reader.read(filename_queue) | |
features = tf.parse_single_example( | |
serialized_exmaple, | |
features={ | |
'image': tf.FixedLenFeature([], tf.string), | |
'label': tf.FixedLenFeature([], tf.int64), |