Skip to content

Instantly share code, notes, and snippets.

View minamorl's full-sized avatar

minamorl minamorl

  • CureApp, Inc
  • Tokyo, Japan
  • 23:09 (UTC +09:00)
View GitHub Profile
@minamorl
minamorl / init.lua
Created April 12, 2024 08:58
My init.lua
-- General settings
vim.opt.clipboard = 'unnamedplus' -- Use system clipboard
vim.opt.completeopt = {'menu', 'menuone', 'noselect'} -- Completion options
vim.opt.mouse = 'a' -- Enable mouse support in all modes
vim.opt.tabstop = 4 -- Number of visual spaces per TAB
vim.opt.softtabstop = 4 -- Number of spaces in tab when editing
vim.opt.shiftwidth = 4 -- Number of spaces for each indentation level
vim.opt.expandtab = true -- Convert tabs to spaces
-- Spelling
import numpy as np
from scipy import stats
import csv
from dateutil import parser
val = []
ctrl = []
cond = parser.parse("2021-11-29T00:00:00Z")
with open('./cta.csv') as file:
type Unpromisify<T> = T extends Promise<infer R> ? R : T;
const withNullCheck = <T extends ((...args: any[]) => any)>(fn: T) => {
return async (...args: Parameters<T>) => {
const result = await fn(...args);
if (result === null) {
throw new Error("Object should not be null.");
}
return result as NonNullable<Unpromisify<ReturnType<T>>>;
}
@minamorl
minamorl / xml-ebnf-names.txt
Created February 2, 2018 11:51
XML ebnf names
// Prolog
prolog
xmldecl
versioninfo
eq
versionnum
misc
// Document Type Definition
doctypedecl
@minamorl
minamorl / package.json
Created February 3, 2017 16:43
My package json
{
...
"author": "minamorl",
"license": "MIT",
"dependencies": {
"@types/bcrypt": "^1.0.0",
"@types/body-parser": "0.0.33",
"@types/bookshelf": "^0.8.34",
"@types/cookie-parser": "^1.3.30",
"@types/cors": "^2.8.0",
@minamorl
minamorl / autofollow.py
Last active July 27, 2016 04:53
gistに直接気持ちで書いたので動くか知らない
import staccato
import time
# must be replaced
consumer_key = "YOURS"
consumer_secret = "YOURS"
access_token_key = "YOURS"
access_token_secret = "YOURS"
TARGET = "username"
SLEEP_TIME = 5
import os
context = list()
def run(arg):
context[-1].run(arg)
class Context:
@minamorl
minamorl / delete_all_tweets_from_csv.py
Last active March 7, 2016 18:58
Simple script to delete all tweets from provided CSV file.
import staccato
import os
import configparser
import csv
import redis
import sys
def import_configurations(path="~/.staccato.conf"):
"""Import oauth1 settings via configparser."""
class MetaData(type):
def __new__(mcs, name, bases, attrs):
for a in attrs:
# Ignore magic names
if a.startswith("_"):
continue
print(a)
return super().__new__(mcs, name, bases, attrs)
index {
print("function `index` is called")
}
main {
print("function `main` is called")
}
# =========>
# Same as: