Skip to content

Instantly share code, notes, and snippets.

View leoluyi's full-sized avatar
🎯
Focusing

Leo Lu leoluyi

🎯
Focusing
View GitHub Profile
@leoluyi
leoluyi / docker-compose-cheatsheet.md
Last active February 22, 2019 06:32 — forked from buonzz/docker-compose-cheatsheet.sh
docker-compose cheatsheet

docker-compose cheatsheet

docker-compose up # Starts multiple containers from docker-compose.yaml in same dir
docker-compose exec <service> <cmd> # Execute command in running container
docker-compose down # Removes associated containers, networks and volumes

$ docker-compose up -d         # start containers in background
@leoluyi
leoluyi / _Nvim-R-Tmux.md
Created January 10, 2019 13:19 — forked from tgirke/_Nvim-R-Tmux.md
Nvim-R-Tmux: An Integrated Working Environment for R
@leoluyi
leoluyi / Readme.md
Created December 19, 2018 10:08 — forked from pjkelly/Readme.md
GitHub Flow: Keeping Feature Branches Up-to-Date & Merging Work Back Into Master

Keeping Feature Branches Up-to-Date & Merging Work Back Into Master

The basic flow is this:

  • When you want to update a feature branch you're working on, rebase on to it.
  • When you're ready to integrate the work you've been doing into the master branch, merge it.

Detailed Step-by-Step

Given the name of your feature branch is registration-page:

@leoluyi
leoluyi / db_tools.py
Created November 13, 2018 04:02 — forked from riffm/db_tools.py
Gentle `drop tables` using sqlalchemy
# -*- coding: utf-8 -*-
from sqlalchemy import create_engine
from sqlalchemy.types import SchemaType
from sqlalchemy.engine import reflection
from sqlalchemy.schema import (
MetaData,
Table,
DropTable,
ForeignKeyConstraint,
@echo off
:: http://weblogs.asp.net/jgalloway/archive/2006/11/20/top-10-dos-batch-tips-yes-dos-batch.aspx
echo %%~1 = %~1
echo %%~f1 = %~f1
echo %%~d1 = %~d1
echo %%~p1 = %~p1
echo %%~n1 = %~n1
echo %%~x1 = %~x1
echo %%~s1 = %~s1
echo %%~a1 = %~a1
@leoluyi
leoluyi / sublime-text-macos-context-menu.md
Created October 20, 2018 16:08 — forked from idleberg/sublime-text-macos-context-menu.md
“Open in Sublime Text” in macOS context-menu

Open in Sublime Text

  • Open Automator
  • Create a new Service
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$@"
  • Set “Pass input” to as arguments
  • Save as Open in Sublime Text
@leoluyi
leoluyi / NERDTree.mkd
Created June 5, 2018 13:05 — forked from m3nd3s/NERDTree.mkd
My Vim Cheat Sheet

NERDTree

o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|

O.......Recursively open the selected directory..................|NERDTree-O|

@leoluyi
leoluyi / install_chrome.sh
Last active October 1, 2018 03:52 — forked from mrtns/gist:78d15e3263b2f6a231fe
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update
@leoluyi
leoluyi / centos_cx_Oracle
Created May 2, 2018 09:39 — forked from floer32/centos_cx_Oracle
CentOS 6: Set up Oracle Instant Client and Python package cx_Oracle
#!/bin/bash
# INSTALL ORACLE INSTANT CLIENT #
#################################
# NOTE: Oracle requires at least 1176 MB of swap (or something around there).
# If you are using CentOS in a VMWare VM, there's a good chance that you don't have enough by default.
# If this describes you and you need to add more swap, see the
# "Adding a Swap File to a CentOS System" section, here:
# http://www.techotopia.com/index.php/Adding_and_Managing_CentOS_Swap_Space