Skip to content

Instantly share code, notes, and snippets.

@n8e
n8e / symlink.sh
Created May 3, 2018 15:34 — forked from bangonkali/symlink.sh
Creating a symlink for visual studio code on mac os x el capitan
@n8e
n8e / Commit_Author.md
Created November 24, 2017 07:39
To change the author of all the commit messages in a branch

Use this when you need to change the author of all the commit messages in a branch. git filter-branch -f --env-filter "GIT_AUTHOR_NAME='n8e'; GIT_AUTHOR_EMAIL='[email protected]'; GIT_COMMITTER_NAME='n8e'; GIT_COMMITTER_EMAIL='[email protected]';" HEAD

After this, then git push origin + to force push the changes to the repository

@n8e
n8e / vs-code.js
Created September 22, 2017 13:21
vs-code custom settings
{
"workbench.sideBar.location": "left",
"editor.fontFamily": "Ubuntu Mono,Source Code Pro, Menlo, Monaco, 'Courier New', monospace",
"editor.fontSize": 16,
"workbench.editor.showTabs": false,
"editor.tabSize": 2,
"files.hotExit": "off",
"files.exclude": {
"**/.git": true,
"**/.svn": true,
@n8e
n8e / 2faOnGithub.md
Created September 22, 2017 12:50
Using Github API on Terminal: Including your 2FA Code from your 3rd party Authenticator App

Authentication: If using 2FA, the code from your Authenticator app needs to be included in the authentication along with your user name and password

$ curl -i -u your_username -v -H "X-Github-OTP:your_authentication_code" https://api.github.com/users/defunkt

This will prompt you for your password:

Enter host password for user 'your_username':

Enter your Github password

@n8e
n8e / web-servers.md
Created June 21, 2017 14:39 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@n8e
n8e / gh-pages-deploy.md
Last active February 8, 2017 15:55 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io) and [gatsby](https://github.com/gatsbyjs/gatsby).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@n8e
n8e / states_hash.json
Created June 28, 2016 15:18 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@n8e
n8e / .bash_profile
Created March 4, 2016 09:13
Using different text colours on the terminal
# terminal colors
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
@n8e
n8e / .bash_profile
Created March 4, 2016 09:11
Git auto-completion for branches
# git auto completion for branches
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi