Skip to content

Instantly share code, notes, and snippets.

View jeasinema's full-sized avatar
💭
I may be slow to respond.

Xiaojian Ma jeasinema

💭
I may be slow to respond.
View GitHub Profile
#include "keymap_common.h"
#include "led.h"
#include "action_layer.h"
/*
* HHKB Layout
*/
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: Default layer
* ,-----------------------------------------------------------.
# !/bin/bash
# $date: 09-16-16
# $purpose: basic configuration
# $author: jeasinema [jeasinema[at]gmail[dot]com]
CREATE_USER_NAME="jeasinema"
# Create account
echo "============= now create an account ============="
sudo useradd -s /usr/bin/fish -m $CREATE_USER_NAME
# !/bin/bash
# $date: 09-16-16
# $purpose: basic configuration
# $author: jeasinema [jeasinema[at]gmail[dot]com]
UNAME="jeasinema"
DOT_FILE="https://github.com/jeasinema/.dotfile.git"
DOT_NAME=".dotfile"
VIM_REPO_NAME="vim-config"
#!/usr/bin/env python
# -*- coding:UTF-8 -*-
# File Name : train_hook.py
# Purpose :
# Creation Date : 14-12-2017
# Last Modified : 2017-12-14 Thu 00:59:06
# Created By : Jeasine Ma [jeasinema[at]gmail[dot]com]
import os
@jeasinema
jeasinema / bsdgames-osx.rb
Created January 1, 2018 02:13 — forked from jdmartin/bsdgames-osx.rb
A homebrew formula for installing bsdgames-osx (updated for macOS Sierra). For now, just plunk it into /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/bsdgames-osx.rb (or, put it in ~/.homebrew/Library/Formula/ and specify this path when installing) and run "brew install bsdgames-osx". Tested successfully with MacOS X 10.12.3.
require 'formula'
class BsdgamesOsx < Formula
desc 'The classic bsdgames of yore for Mac OS X and macOS.'
homepage 'https://github.com/ctdk/bsdgames-osx'
url 'https://github.com/ctdk/bsdgames-osx/archive/bsdgames-osx-2.19.3.tar.gz'
sha256 '699bb294f2c431b9729320f73c7fcd9dcf4226216c15137bb81f7da157bed2a9'
head 'https://github.com/ctdk/bsdgames-osx.git'
version '2.19.3'
depends_on "bsdmake" => ':build'
@jeasinema
jeasinema / bar.py
Created April 12, 2018 15:26
A customized progress bar, by @id9502
def bar(current, total, prefix="", suffix="", bar_sz=25, end_string=None):
'''
Usage:
bar(iter+1, epoch_amount, "Iters:{}/{}".format(iter, epoch_amount), end_string='')
'''
sp = ""
print("\x1b[2K\r", end='')
for i in range(bar_sz):
if current * bar_sz // total > i:
sp += '='
@jeasinema
jeasinema / split_image.py
Created May 9, 2018 13:08
An utils for draw split image
#!/usr/bin/env python
# -*- coding:UTF-8 -*-
# File Name : split_draw.py
# Purpose :
# Creation Date : 09-05-2018
# Last Modified : 2018年05月09日 星期三 21时06分55秒
# Created By : Jeasine Ma [jeasinema[at]gmail[dot]com]
import numpy as np
@jeasinema
jeasinema / test_bn.py
Created May 28, 2018 02:14
Different behaviours of batch normalization
import numpy as np
def main_mxnet():
import mxnet as mx
from mxnet import gluon, autograd
from mxnet.gluon import nn
net = nn.Sequential()
with net.name_scope():
import os
import numpy as np
import h5py as h5
from scipy.misc import imread
from struct import pack, unpack
import IPython
import math
# Extract pointcloud from rgb-d, then convert it into obj coordinate system(tsdf/poisson reconstructed object)
# In fact, merged_cloud.ply is exactly composed by pointclouds that transformed into this coordinate system
@jeasinema
jeasinema / augmentations.py
Created June 4, 2018 13:27
Generic augmentation
import torch
from torchvision import transforms
import cv2
import numpy as np
import types
from numpy import random
def intersect(box_a, box_b):
max_xy = np.minimum(box_a[:, 2:], box_b[2:])