Skip to content

Instantly share code, notes, and snippets.

Dani de la Cruz d4nidev

Block or report user

Report or block d4nidev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@d4nidev
d4nidev / remove-node-modules.sh
Created Jun 18, 2019
Remove all node_modules folders
View remove-node-modules.sh
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
@d4nidev
d4nidev / git-clean.sh
Last active Feb 27, 2019
Removes all local branches in a git repository which are already merged or deleted from origin.
View git-clean.sh
git fetch -p && for branch in `git branch -vv --no-color | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done
@d4nidev
d4nidev / git-aliases.sh
Last active Feb 4, 2018
My aliases for git
View git-aliases.sh
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.unstage 'reset HEAD --'
git config --global alias.last 'log -1 HEAD'
@d4nidev
d4nidev / settings.json
Created Oct 30, 2017
Visual Studio user settings
View settings.json
{
"atomKeymap.promptV3Features": true,
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.fontSize": 13,
"editor.formatOnPaste": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.tabSize": 2,
"workbench.fontAliasing": "antialiased",
"workbench.iconTheme": "material-icon-theme",
@d4nidev
d4nidev / steps.md
Created May 26, 2017
Move history from a repo to another, filtering by folder
View steps.md
  1. git clone
  2. cd
  3. git remote rm origin
  4. git filter-branch --subdirectory-filter <directory 1> -- --all

You may need also to merge histories, if the new repo already exists. In order to do that, make:

  1. git pull --allow-unrelated-histories

And finally,

@d4nidev
d4nidev / reset.sh
Created Mar 9, 2017
Git Tip: Reset unstaged changes and files
View reset.sh
# Revert changes to modified files.
git reset --hard
# Remove all untracked files and directories. (`-f` is `force`, `-d` is `remove directories`)
git clean -fd
@d4nidev
d4nidev / firstclass.js
Created Feb 5, 2017
First class function
View firstclass.js
const writeLog = (text) => console.log(text)
@d4nidev
d4nidev / script.sh
Created Jan 18, 2017
Git clean local branches
View script.sh
git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d
@d4nidev
d4nidev / docker-shell.sh
Last active Oct 13, 2016
Open a shell terminal with a docker container given its name
View docker-shell.sh
docker exec -it myContainerName sh
You can’t perform that action at this time.