Skip to content

Instantly share code, notes, and snippets.

View Jeanhwea's full-sized avatar
💻
Working

Jinghui Hu Jeanhwea

💻
Working
View GitHub Profile
@Jeanhwea
Jeanhwea / build-tensorflow-from-source.md
Created November 28, 2018 13:29 — forked from Brainiarc7/build-tensorflow-from-source.md
Build Tensorflow from source, for better performance on Ubuntu.

Building Tensorflow from source on Ubuntu 16.04LTS for maximum performance:

TensorFlow is now distributed under an Apache v2 open source license on GitHub.

On Ubuntu 16.04LTS+:

Step 1. Install NVIDIA CUDA:

To use TensorFlow with NVIDIA GPUs, the first step is to install the CUDA Toolkit as shown:

@Jeanhwea
Jeanhwea / install_sqlplus.md
Created November 20, 2018 08:18 — forked from tcnksm/install_sqlplus.md
How to install oracle client to Ubuntu 12.04

Install SQL*Plus

  1. Download .rpm package here
    • oracle-instantclinet*-basic-*.rpm
    • oracle-instantclinet*-devel-*.rpm
    • oracle-instantclinet*-sqlplus-*.rpm
  2. Install alien (sudo apt-get install alien)
  3. Convert the rpm files and install
    • sudo alien -i oracle-instantclinet*-basic-*.rpm
  • sudo alien -i oracle-instantclinet*-devel-*.rpm
@Jeanhwea
Jeanhwea / codesign_gdb.md
Created April 18, 2018 11:21 — forked from gravitylow/codesign_gdb.md
Codesign gdb on macOS

If you are getting this in gdb on macOS while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
  2. In menu, open Keychain Access > Certificate Assistant > Create a certificate
  3. Give it a name (e.g. gdbc)
@Jeanhwea
Jeanhwea / theRootOfLisp.el
Created August 3, 2017 16:54
The Root of Lisp
;; http://www.paulgraham.com/rootsoflisp.html
;; ========================================
;; ATOM := [a-zA-Z]*
;; LIST := (EXPR1 EXPR2 ...)
;; EXPR := ATOM | LIST
;; EXPR
foo
()
@Jeanhwea
Jeanhwea / em-config.el
Created June 25, 2017 03:54
jedi-starter.el config for emacs
;; Package setup
(require 'package)
(package-initialize)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(defvar local-packages '(projectile auto-complete epc jedi))
(defun uninstalled-packages (packages)
@Jeanhwea
Jeanhwea / Makefile
Last active June 2, 2017 14:51
sync remote and local folder
REMOTE := username@hostname:path/
LOCAL := .
EXCLUDES := --exclude='*.pyc' --exclude='.git' --exclude='cscope*' --exclude='Makefile'
all: sync
sync: get put
get:
rsync --archive --verbose --recursive --rsh=ssh $(EXCLUDES) $(REMOTE) $(LOCAL)
@Jeanhwea
Jeanhwea / weixin_signature.py
Last active August 3, 2017 16:10
Generate Wechat Signature in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib
import random
def gen_nonce(length = 16):
base = 'abcdefghijklmnopqrstvuwxyzABCDEFGHIJKLMNOPQRSTVUWXYZ0123456789'
chars = [base[random.randrange(0, len(base))] for _ in xrange(length)]
@Jeanhwea
Jeanhwea / deepcopy.py
Last active May 29, 2017 15:17
python deepcopy
import copy
class Student(object):
@property
def score(self):
return self._score
@score.setter
def score(self, value):
@Jeanhwea
Jeanhwea / pairs-on-new-line.vim
Created April 26, 2017 03:29
vim 新行自动添加括号
function! s:OpenSpecial(ochar,cchar)
echo "OpenSpecial"
let line = getline('.')
let col = col('.') - 2
if(line[col] != a:ochar)
if(col > 0)
return "\<ESC>a\<CR>"
else
return "\<CR>"
endif
@Jeanhwea
Jeanhwea / pairs-on-new-line.vim
Created April 26, 2017 03:28
vim 新行自动添加括号
function! s:OpenSpecial(ochar,cchar)
echo "OpenSpecial"
let line = getline('.')
let col = col('.') - 2
if(line[col] != a:ochar)
if(col > 0)
return "\<ESC>a\<CR>"
else
return "\<CR>"
endif