Skip to content

Instantly share code, notes, and snippets.

@JamesYuan
JamesYuan / SSL-certs-OSX.md
Created September 12, 2018 05:24 — forked from croxton/SSL-certs-OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@JamesYuan
JamesYuan / mysql_backup.sh
Created July 13, 2018 05:34 — forked from tleish/mysql_backup.sh
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
@JamesYuan
JamesYuan / git-branch-simplify.md
Created January 8, 2018 06:08 — forked from datagrok/git-branch-simplify.md
How to simplify the graph produced by git log --graph

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.

@JamesYuan
JamesYuan / socks.el
Created November 1, 2017 08:57 — forked from et2010/socks.el
socks proxy settings for emacs url package.
(setq url-gateway-method 'socks)
(setq socks-server '("Default server" "127.0.0.1" 1080 5))
(defun coder/go-guru-set-current-package-as-main ()
"GoGuru requires the scope to be set to a go package which
contains a main, this function will make the current package the
active go guru scope, assuming it contains a main"
(interactive)
(let* ((filename (buffer-file-name))
(gopath-src-path (concat (file-name-as-directory (go-guess-gopath)) "src"))
(relative-package-path (directory-file-name (file-name-directory (file-relative-name filename gopath-src-path)))))
(setq go-guru-scope relative-package-path)))
@JamesYuan
JamesYuan / GoPath Bin
Created October 23, 2017 09:22 — forked from kendellfab/GoPath Bin
Add this to $PATH variable to have multiple gopath bin directories.
${GOPATH//://bin:}/bin
@JamesYuan
JamesYuan / some_links.md
Created May 3, 2016 02:47 — forked from todvora/some_links.md
Some interesting articles about JPA/Hibernate Multi-Tenancy
@JamesYuan
JamesYuan / Emacs.md
Created April 12, 2016 13:31
Setting up Emacs daemon on OS X

Setting up Emacs daemon on OS X

Tired of waiting for emacs to start on OS X? This step by step guide will teach you how to install the latest version of emacs and configure it to start in the background (daemon mode) and use emacsclient as your main editor.

Install Homebrew

First you'll need to install the [Homebrew package manager][brew] if yo haven't already. It is amazing.

@JamesYuan
JamesYuan / emacs.sh
Created April 12, 2016 13:14 — forked from masaedw/emacs.sh
run emacs.app or emacsclient on Mac OS X
function e() {
if [ -z `pgrep Emacs` ]; then
env LANG=C open -a Emacs "$@"
return
fi
local client="/Applications/MacPorts/Emacs.app/Contents/MacOS/bin/emacsclient"
local uid=`id -u`
local socket="$TMPDIR"/emacs"$uid"/server