Skip to content

Instantly share code, notes, and snippets.

View fx-kirin's full-sized avatar
🌴
Somewhere on the planet.

fx-kirin fx-kirin

🌴
Somewhere on the planet.
View GitHub Profile
@fx-kirin
fx-kirin / skeleton-daemon.sh
Created March 21, 2017 01:59 — forked from shawnrice/skeleton-daemon.sh
A template to write a quick daemon as a bash script
#!/bin/sh
# This is a skeleton of a bash daemon. To use for yourself, just set the
# daemonName variable and then enter in the commands to run in the doCommands
# function. Modify the variables just below to fit your preference.
daemonName="DAEMON-NAME"
pidDir="."
pidFile="$pidDir/$daemonName.pid"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fx-kirin
fx-kirin / patch.diff
Last active August 7, 2018 04:46
Python 3.6 MingW 32 Compile environment.
--- cygwinccompiler.py
+++ cygwinccompiler.py
@@ -82,7 +82,18 @@ def get_msvcr():
elif msc_ver == '1600':
# VS2010 / MSVC 10.0
return ['msvcr100']
+ elif msc_ver == '1700':
+ # Visual Studio 2012 / Visual C++ 11.0
+ return ['msvcr110']
+ elif msc_ver == '1800':
javascript:date = new Date(); url_root = 'http://nbviewer.ipython.org/'; url = null; gist_re = /^https?:\/\/gist\.github\.com\/(?:\w+\/)?([a-f0-9]+)$/; github_re = /^https:\/\/(github\.com\/.*\/)blob\/(.*\.ipynb)$/; https_re = /^https:\/\/(.*\.ipynb)$/; http_re = /^http:\/\/(.*\.ipynb)$/; loc = location.href; if (gist_re.test(loc)) { gist = gist_re.exec(loc); url = url_root + gist[1]; } else if (github_re.test(loc)) { path = github_re.exec(loc); url = url_root + 'urls/raw.' + path[1] + path[2]; } else if (https_re.test(loc)) { path = https_re.exec(loc); url = url_root + 'urls/' + path[1]; } else if (http_re.test(loc)) { path = http_re.exec(loc); url = url_root + 'url/' + path[1];} if (url) {void(window.open(url, 'nbviewer' + date.getTime()));}
@fx-kirin
fx-kirin / order-book-example.py
Last active June 16, 2020 07:25
Orderbook example with PySimpleGui
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2020 fx-kirin <fx.kirin@gmail.com>
#
from random import randint
import PySimpleGUI as sg