$ docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ls='ls -F --color --show-control-chars' | |
alias ll='ls -l' | |
alias gits='git status ' | |
alias gita='git add ' | |
alias gitb='git branch ' | |
alias gitc='git commit' | |
alias gitd='git diff' | |
alias gito='git checkout ' | |
alias gitl='git log --graph --pretty=format:"%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset" --abbrev-commit --date=relative' | |
alias gitr='git remote update' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type feature -> title: Features, description: A new feature | |
type fix -> title: Bug Fixes, description: A bug fix | |
type docs -> title: Documentation, description: Documentation only changes | |
type style -> title: Styles, description: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) | |
type refactor -> title: Code Refactoring, description: A code change that neither fixes a bug nor adds a feature | |
type perf -> title: Performance Improvements, description: A code change that improves performance | |
type test -> title: Tests, description: Adding missing tests or correcting existing tests | |
type build -> title: Builds, description: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) | |
type ci -> title: Continuos Integration, description: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) | |
type chore -> title: Chores, description: Other changes that don't modify src or test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://stackoverflow.com/questions/32122784/alias-script-to-delete-all-local-and-remote-git-branches-with-a-specific-prefix | |
git branch -D $(printf "%s\n" $(git branch) | grep 'feature/') | |
# Or this will work too to remove all remote branches: | |
# https://coderwall.com/p/eis0ba/remove-a-thousand-stale-remote-branches-on-git | |
git branch -r | awk -F/ '/\/feature/{print $2}' | xargs -I {} git push origin :{} | |
# Prune all origin branches | |
git remote prune origin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getAllGithubStars = async () => { | |
const your_username = 'knowankit' | |
const URL = `https://api.github.com/users/${your_username}/repos`; | |
const response = await fetch(URL); | |
const data = await response.json(); | |
let stars = 0; | |
for (let i = 0; i < data.length; i++) { | |
stars += data[i]['stargazers_count']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Heaps */ | |
// left child: i * 2 | |
// right child: i * 2 + 1 | |
// parent: i / 2 | |
let MinHeap = function() { | |
let heap = [null]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpResponse | |
from openpyxl import Workbook | |
from openpyxl.writer.excel import save_virtual_workbook | |
def home_page(request): | |
wb = Workbook() | |
ws = wb.active | |
ws.append(['First Name', 'Last Name']) | |
data = [{ |