Skip to content

Instantly share code, notes, and snippets.

View moskytw's full-sized avatar

Mosky Liu moskytw

View GitHub Profile
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
>>> print('C:\Users\Mosky\Desktop')
File "<stdin>", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
>>> print(r'C:\Users\Mosky\Desktop')
C:\Users\Mosky\Desktop