git checkout --orphan future-master
git add -A # Add all files and commit them
git commit
git branch -D master # Deletes the master branch
git branch -m master # Rename the current branch to master
git push -f origin master # Force push master branch to github
git gc --aggressive --prune=all # remove the old files
#! /bin/zsh -f | |
disable which # builtin | |
alias -g i=install | |
pnpm () { command pnpm $@ --config ${NPM_CONFIG_USERCONFIG:-~/.npmrc} } | |
if (which -s pnpm) npm () { | |
NODE_BIN=`brew --prefix node`/bin | |
export PATH=$PATH:$NODE_BIN |
{ | |
"libs": [ | |
"browser", | |
"underscore", | |
"jquery" | |
], | |
"plugins": { | |
"node": {} | |
} | |
} |
#!/bin/bash | |
# This script creates a new project (or site) under /var/sites and creates | |
# new virtual host for that site. With the options a site can also | |
# install the latest version of Laravel directly. | |
# This script was originally based on the following script by @Nek from | |
# Coderwall: https://coderwall.com/p/cqoplg | |
# Display the usage information of the command. | |
create-project-usage() { |
Vim provides built-in mechanisms to search through projects in the form of the grep
command.
However, on large projects, grep is known to be slow; and hence people have been switching to simpler searchers like ack, and faster, parallel (metal?) searchers like ag and pt.
Correspondingly, several plugins have been created that integrate these tools in vim: ack.vim, ag.vim, etc.
However, it's actually very easy to get the functionalities these plugins provide (faster search, results in quickfix-window, jumps, previews, and so on) in vanilla Vim itself; in fact, Vim already populates the grep-search results in a quickfix window. We just need to tell Vim to do the following things (use-case: ag):
- Use ag as the default grep program
- Open quickfix window by default
- Create mappin
If you work across many computers (and even otherwise!), it's a good idea to keep a copy of your setup on the cloud, preferably in a git repository, and clone it on another machine when you need.
Thus, you should keep the .vim
directory along with your .vimrc
version-controlled.
But when you have plugins installed inside .vim/bundle
(if you use pathogen), or inside .vim/pack
(if you use Vim 8's packages), keeping a copy where you want to be able to update the plugins (individual git repositories), as well as your vim-configuration as a whole, requires you to use git submodules.
Initialize a git repository inside your .vim
directory, add everything (including the vimrc), commit and push to a GitHub/BitBucket/GitLab repository:
cd ~/.vim
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.
$ python -m SimpleHTTPServer 8000
#!/bin/bash -e | |
clear | |
echo "============================================" | |
echo "WordPress Install Script" | |
echo "============================================" | |
echo "Database Name: " | |
read -e dbname | |
echo "Database User: " | |
read -e dbuser | |
echo "Database Password: " |