Skip to content

Instantly share code, notes, and snippets.

View mopemope's full-sized avatar
🏠
Working from home

Yutaka Matsubara mopemope

🏠
Working from home
View GitHub Profile
@mopemope
mopemope / xmobarrc
Created January 12, 2016 17:18
xmonad
-- -*- mode:haskell -*-
Config { font = "xft:Ricty:size=12"
, bgColor = "#1c1c1c"
, fgColor = "#757575"
, position = TopSize C 100 16
-- , position = Static { xpos = 37 , ypos = 0, width = 1845, height = 18 }
, lowerOnStart = False
, overrideRedirect = False
, border = NoBorder
, borderColor = "#26a69a"
@mopemope
mopemope / dynamicbloom.c
Created July 11, 2011 03:28
Dynamic Bloom Filter
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <inttypes.h>
#include <math.h>
typedef struct {
@mopemope
mopemope / qgmlwy.typ
Created February 5, 2018 06:57
Gtypist lessons for the qgmlwy
G:MENU
*:lesson_0
B:home row-first finger ngrams drill
T:a drill on word pieces including the letters n, a. (29 found)
D:a a a ana ana ana nann nann nann nana nana nana ann ann ann aan aan
:aan nan nan nan nnan nnan nnan nna nna nna n n n anan anan anan anna
:anna anna nan n anna nann anan a ana aan ann nana nnan nna nana aan
:anan nnan ann a anna n nann nan nna ana nana a ann nnan nann anna n
:nan nna ana aan anan
@mopemope
mopemope / lets_split.json
Created November 20, 2017 12:06
Let's split setting
{"version":1,"keyboard":{"keys":[{"id":0,"legend":"","state":{"x":0.5,"y":1,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"a":7},"row":0,"col":0,"keycodes":[{"id":"RESET","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":1,"legend":"Q","state":{"x":1.5,"y":1,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0,"a":4},"row":0,"col":1,"keycodes":[{"id":"KC_Q","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fiel
@mopemope
mopemope / xmobarrc
Created October 19, 2017 10:12
卍卍卍卍卍卍卍卍卍卍卍卍卍卍卍卍卍卍卍卍卍卍卍卍卍
Config { font = "xft:Ricty:size=13:antialias=true"
, bgColor = "#1c1c1c"
, fgColor = "#FFFFFF"
, alpha = 10
, position = TopSize C 100 16
, lowerOnStart = False
, overrideRedirect = False
, border = NoBorder
, commands = [ Run Network "wlp1s0" ["-t" , "Net:<rx>Kb/s <tx>Kb/s "
, "-L" , "40"
@mopemope
mopemope / crawler.py
Last active October 19, 2017 04:53
2ch crawler prototype
# -*- coding: utf-8 -*-
import requests
from pyquery import PyQuery as pq
import parser
import re
import datastore
url_re = re.compile(".*/(\d+)/.*", re.M)
@mopemope
mopemope / common.h
Created June 29, 2011 08:10
lock-free queue and thread pool
#ifndef COMMON_H
#define COMMON_H
//#ifdef DEVELOP
#define DEBUG(...) \
do { \
/*printf("%-22s%4u: ", __FILE__, __LINE__);*/ \
/*printf("%-22s %-32s%4u: ", __FILE__, __func__, __LINE__);*/ \
printf("%s%4u: ", __FILE__, __LINE__); \
printf(__VA_ARGS__); \
@mopemope
mopemope / nspawn-container
Last active October 29, 2016 16:53
nspawn-container
#!/bin/bash
TOOLBOX_DOCKER_IMAGE=$1
TOOLBOX_USER=root
machinename=$(echo "${USER}-${TOOLBOX_DOCKER_IMAGE}" | sed -r 's/[^a-zA-Z0-9_.-]/_/g')
machinepath="/var/lib/toolbox/${machinename}"
if [ ! -d ${machinepath} ] || systemctl is-failed ${machinename} ; then
sudo mkdir -p "${machinepath}"
from os import path
from werkzeug import secure_filename
import eventlet
from eventlet.green import urllib2
from pyquery import PyQuery as pq
from urlparse import urlparse
import psyco
psyco.full()
search_urls = [
@mopemope
mopemope / xmonad.hs
Created August 24, 2016 23:01
xmonad.hs
--------------------------------------------------------------------------------
-- __ ____ __ _ --
-- \ \/ / \/ | ___ _ __ __ _ __| | --
-- \ /| |\/| |/ _ \| '_ \ / _` |/ _` | --
-- / \| | | | (_) | | | | (_| | (_| | --
-- /_/\_\_| |_|\___/|_| |_|\__,_|\__,_| --
-- --
-------------------------------------------------------------------------------