Skip to content

Instantly share code, notes, and snippets.

View moskytw's full-sized avatar

Mosky Liu moskytw

View GitHub Profile
#!/bin/bash
START_DATE="2025-07-01"
GIT_TMP=$(mktemp)
CCUSAGE_TMP=$(mktemp)
# 1. Git 每日 Python 行數(新增+刪除)
git log --since="$START_DATE" --pretty=format:'%ad' --date=short --numstat -- '*.py' |
awk '
NF==1 { date=$1 }
from typing import List
# Collection is Sized, Iterable, Container (supports __contains__)
from collections.abc import Sequence, Collection
def accept_list(x: list) -> None:
pass
#!/usr/bin/env python
from typing import Callable, Any
import warnings
import funcy as fy
import pandas as pd
import pymysql
{
"title": "Kill unexpectedly repeated return_or_enter",
"rules": [
{
"description": "Map the repeated return_or_enter in 100 ms to none",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "return_or_enter",
(function () {
const intervalMiliseconds = 10;
const waitToLoadMiliseconds = 1000;
const getUnsaveA = () => document.querySelector('.uiContextualLayerPositioner:not(.hidden_elem) li:last-child a');
const scrollToBottom = () => window.scrollTo(0, document.body.scrollHeight);
const unsaveAndLoad = (recursive) => {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
from math import log
import funcy as fy
def f(x):
return x
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@moskytw
moskytw / child.py
Last active November 6, 2017 09:52
parent.py write to and read from the child.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
while True:
s = raw_input('Child: ')
if not s:
break
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import signal
from time import sleep
from multiprocessing import TimeoutError
from multiprocessing.dummy import Pool