Skip to content

Instantly share code, notes, and snippets.

@inlinechan
inlinechan / init.el
Created July 29, 2020 08:01
flycheck-mypy
;; Not sure both are necessary
(use-package flycheck-mypy
:ensure t
:config
(add-hook 'python-mode-hook (lambda ()
(add-to-list 'flycheck-checkers 'python-mypy))))
(use-package flycheck
:init (global-flycheck-mode)
:config
(add-hook 'python-mode-hook
@inlinechan
inlinechan / emacs-lsp-python.el
Last active March 26, 2020 07:56
emacs lsp python
(use-package lsp-mode
:custom
;; (lsp-auto-guess-root nil)
(lsp-prefer-flymake nil)
(lsp-ui-doc-position 'bottom)
:hook ((python-mode . lsp))
:commands lsp)
(use-package lsp-ui
:config
# Python
import asyncio
import ccxt.async_support as ccxt
from datetime import datetime, timedelta
async def print_bitfinex_ethbtc_ticker():
bitfinex = ccxt.bitfinex()
# print(await bitfinex.fetch_ticker('ETH/BTC'))
@inlinechan
inlinechan / hc-webos.el
Last active December 2, 2018 13:58
hc-webos.el
;;; Package --- Summary
;;; Commentary:
;;; Code:
(require 'find-dired)
(defun webos-top (path &optional strict)
"Return wtop from PATH.
@inlinechan
inlinechan / market.go
Last active November 29, 2018 08:25
get data from upbit API
package main
// Get ticker from upbit and collect high volume and acc price
import (
"encoding/json"
"fmt"
"net/http"
"sort"
"strings"
@inlinechan
inlinechan / candlestick.dem
Created November 17, 2017 00:34
candlestick from btcusd 4h
set title "BTCUSD 4H" at screen 0.5, screen 0.95 center
# set yrange [75:105]
# set ytics (105, 100, 95, 90, 85, 80)
# set xrange [50:253]
set lmargin 9
set rmargin 2
set grid
set boxwidth 0.2
set style fill solid
set style arrow 1 head filled ls 1
// UnmarshalJSON from string to time.Time
package main
import (
"encoding/json"
"fmt"
"time"
)
type Response struct {
@inlinechan
inlinechan / test_json_unmarshal.go
Created October 19, 2017 03:04
UnmarshalJSON from []float64 to struct(Value)
// UnmarshalJSON from []float64 to struct(Value)
package main
import (
"encoding/json"
"fmt"
)
type Value struct {
First float64
@inlinechan
inlinechan / save_mms.sh
Created May 22, 2017 07:47
save mms to mp3
#!/bin/bash
# for crontab
export PATH=$HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
URL=mms://211.181.136.136/livefm
DESTDIR=$HOME/Music/chulsoo
RECIPIENT='foo@bar.com'
WAVFILE=$(date +\%Y\%m\%d\%H).wav
DURATION=3600
@inlinechan
inlinechan / init.el
Created March 10, 2017 04:46
init.el use-package
;;; init.el --- My own emacs configuration
;; Copyright (C) 2017 Hyungchan Kim
;; Author: Hyungchan Kim <inlinechan@gmail.com>
;; Keywords: lisp use-package
;;; Commentary:
;; `use-package'