Skip to content

Instantly share code, notes, and snippets.

@dseeni
dseeni / Setting_upa_new_repo.md
Created May 2, 2019 05:00 — forked from alexpchin/Setting_upa_new_repo.md
Create a new repository on the command line

Setting up a new Git Repo

##Create a new repository on the command line

touch README.md
git init
git add README.md
git commit -m "first commit"

git remote add origin git@github.com:alexpchin/.git

@dseeni
dseeni / cmder.md
Created May 3, 2019 06:16 — forked from nickautomatic/cmder.md
Setting up Cmder to use bash by default

Set up cmder to use msysgit / bash by default

  • Install cmder_mini (msysgit is already installed, so no need for full version)
  • In Cmder, open settings: Win + Alt + P
  • Under Startup > Tasks, add a task called {bash} with the following settings:
    • Task parameters (set icon):
      • For Cmder icon: /icon "%CMDER_ROOT%\cmder.exe"
      • For Git icon: /icon "C:\Program Files (x86)\Git\etc\git.ico"
    • Commands (open Git's bash shell):
  • "C:\Program Files (x86)\Git\bin\sh.exe" -l -new_console:d:%USERPROFILE%
@dseeni
dseeni / Bash Profile Backup
Created May 3, 2019 07:33 — forked from oscarmorrison/Bash Profile Backup
Bash Profile Backup
export PS1="\e[44mogem@local:\e[m \w \[$txtcyn\]\$git_branch\[$txtrst\] \n$ "
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export GITAWAREPROMPT=~/.bash/git-aware-prompt
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export PATH=$PATH:~/.scripts/
export PATH=$PATH:/usr/local/bin
export PATH="$HOME/.node/bin:$PATH"
source $GITAWAREPROMPT/main.sh
@dseeni
dseeni / git-aliases.md
Created May 3, 2019 08:08 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@dseeni
dseeni / git_bash_here.ahk
Created May 4, 2019 05:46 — forked from yiboyang/git_bash_here.ahk
Git bash here in Windows Explorer with Ctrl + Alt + T
;
; AutoHotkey Version: 1.1
; Language: English
; Platform: Win9x/NT
; Author: Yibo
;
; Script Function:
; Define the shortcut Ctrl + Alt + T for launching Git bash in current folder in Windows Explorer
;
@dseeni
dseeni / .gitignore
Created May 4, 2019 08:36 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@dseeni
dseeni / git-recover-branch.md
Created May 4, 2019 14:41 — forked from jbgo/git-recover-branch.md
How to recover a git branch you accidentally deleted

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring
@dseeni
dseeni / keybindings.json
Created May 4, 2019 15:24 — forked from kickbase/keybindings.json
[VSCode] [Houdini] Keyboard settings with Vim plugin
{
"editor.fontFamily": "Ricty Diminished",
"editor.fontSize": 15,
"editor.formatOnType": true,
"editor.formatOnSave": true,
"editor.wordWrap": "on",
"editor.scrollBeyondLastLine": false,
"workbench.startupEditor": "newUntitledFile",
"python.linting.enabledWithoutWorkspace": false,
"typescript.check.npmIsInstalled": false,
@dseeni
dseeni / pre-commit.run-pytest.sh
Created May 4, 2019 17:04 — forked from BARJ/pre-commit.run-pytest.sh
pre-commit hook that runs pytest
#!/bin/sh
RED='\033[0;31m'
NC='\033[0m' # No Color
test_results=$(script -q /dev/null pipenv run python -m pytest ./test -v --tb=no)
if [ $? -eq 1 ]; then
printf "${RED}CANNOT COMMIT, PYTEST FAILED\n\nPYTEST RESULTS:\n"
echo "$test_results"
exit 1
fi