Skip to content

Instantly share code, notes, and snippets.

View NorikDavtian's full-sized avatar
🚢
Shipping

Norik Davtian NorikDavtian

🚢
Shipping
View GitHub Profile
# git rebase --onto <branch name>~<first commit number to remove> <branch name>~<first commit to be kept> <branch name>
git rebase --onto repair~3 repair~1 repair
$ docker system prune -a

WARNING! This will remove:
	- all stopped containers
	- all volumes not used by at least one container
	- all networks not used by at least one container
	- all images without at least one container associated to them
Are you sure you want to continue? [y/N] y

JS Decorators Example for Redux Connect

In general, this would be used as follows:

class MyReactComponent extends React.Component {}

export default connect(mapStateToProps, mapDispatchToProps)(MyReactComponent);

However, because of how the decorator syntax works, this can be replaced with:

@connect(mapStateToProps, mapDispatchToProps)
"email":.?"[a-z|A-Z|0-9|@|\.]*
# add this function to your bash profile, in my case ~/.zshrc
# FROM: https://dev.to/ricardomol/note-taking-from-the-command-line-156
# Examples:
#
# notes <<NOTE
# This is a very long note
# because sometimes I like
# to write explanations of
# my commands and such.
# NOTE
git clone --depth 1 -b $src_branch $repo_src_url $dir
@NorikDavtian
NorikDavtian / .bash_aliases
Created May 31, 2017 00:51
Docker cleanup bash aliases
# ~/.bash_aliases
# https://www.calazan.com/docker-cleanup-commands/
# Kill all running containers.
alias dockerkillall='docker kill $(docker ps -q)'
# Delete all stopped containers.
alias dockercleanc='printf "\n>>> Deleting stopped containers\n\n" && docker rm $(docker ps -a -q)'
# Delete all untagged images.
@NorikDavtian
NorikDavtian / LICENSE
Last active April 28, 2018 09:51
LICENSE
MIT License
Copyright (c) 2018 Norik Davtian
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
quote_type = single
@NorikDavtian
NorikDavtian / edit-git-config.sh
Created May 23, 2017 23:20
edit global git config
git config --global --edit