Skip to content

Instantly share code, notes, and snippets.

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

joonhwan joonhwan

🏠
Working from home
View GitHub Profile
(defun cd (dir)
"Make DIR become the current buffer's default directory.
If your environment includes a `CDPATH' variable, try each one of
that list of directories (separated by occurrences of
`path-separator') when resolving a relative directory name.
The path separator is colon in GNU and GNU-like systems."
(interactive
(list
;; FIXME: There's a subtle bug in the completion below. Seems linked
;; to a fundamental difficulty of implementing `predicate' correctly.
@joonhwan
joonhwan / ContextOwnedStateMachine.cs
Last active November 15, 2016 01:41
Context Owned StateMachine usage proposal. (using stateless library)
using System;
using Stateless;
namespace HelloStatemachine
{
public interface IHaveContext<T>
{
T Context { get; set; }
};
Hint from
http://cjqed.com/blog/polyglot-persistence-and-transactionscope-in-c/
http://paxcel.net/blog/extending-transaction-scope-to-non-database-transactions-using-resource-manager/
and read
http://www.codeproject.com/Articles/690136/All-About-TransactionScope
@joonhwan
joonhwan / LinqHierachyBuildQuery.cs
Created October 25, 2018 00:50
Hiearchy를 가지는 Composite Key에 대해 계층을 만드는 LINQ예
public class SeqKeyRepository
{
public Dictionary<long, Dictionary<long, Dictionary<long, Dictionary<long, HashSet<long>>>>> FindHierachies()
{
return FindAll()
.GroupBy(key => key.DeviceId)
.ToDictionary(deviceGroup => deviceGroup.Key, deviceGroup =>
{
return deviceGroup
.GroupBy(key => key.SeqId)
@joonhwan
joonhwan / Vagrantfile
Created December 5, 2018 23:44 — forked from mcharytoniuk/Vagrantfile
Vagrant + docker-compose
Vagrant.configure(2) do |config|
config.vm.box = "phusion/ubuntu-14.04-amd64"
config.vm.network "forwarded_port", guest: 3306, host: 3306
# If errors occur, try running "vagrant provision" manually
# after "vagrant up"
config.vm.provision :docker
# To use docker_compose as a provisioning tool, install
# vagrant-docker-compose plugin first. It should also solve the
version: '3.7'
# starts 4 docker containers running minio server instances. Each
# minio server's web interface will be accessible on the host at port
# 9001 through 9004.
services:
minio1:
image: minio/minio:edge
volumes:
- data1-1:/data1
@joonhwan
joonhwan / mibdb-test.py
Created February 26, 2020 01:23
Simplest python Bdb extension(just for study)
import pdb
import wdb
from mibdb import MiBdb
d = MiBdb()
d.set_trace()
d.set_breakpoint("simplecall.py", 12)
d.set_breakpoint("simplecall.py", 16)
def a():
@joonhwan
joonhwan / TrailetsDemo.md
Last active June 2, 2020 00:51
python traitlets demo

다음 명령어 실행가능.

python midews.py --help
python midews.py --help-all
python midews.py dsa --help
python midews.py dsa --help-all
python midews.py dsa --generate-config
python midews.py dsa
python midews.py sra
@joonhwan
joonhwan / _display-breakpoints.scss
Created March 14, 2021 06:29
display current breakpoint in lower left page
@mixin display-breakpoints {
&:after {
content: "xs";
position: fixed;
width: 30px;
font-size: 12px;
text-align: center;
background-color: black;
color: lime;
bottom: 0;
@joonhwan
joonhwan / .gitconfig
Last active August 19, 2021 01:12
gitconfig @ office
[core]
# editor = code --wait
pager = less -x4
trustctime = false
filemode = false
compression = 0
quotepath = false
autocrlf = true
fscache = true
preloadindex = true