git filter-branch --force --commit-filter '
if [ "$GIT_COMMITTER_EMAIL" = "wrong@email.com" ];
then
export GIT_COMMITTER_NAME="New Name";
export GIT_AUTHOR_NAME="New Nam";
export GIT_COMMITTER_EMAIL="new@example.com";
export GIT_AUTHOR_EMAIL="new@example.com";
fi;
git commit-tree "$@"
This file contains hidden or 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
| #!/bin/bash | |
| # Sometimes you need to move your existing git repository | |
| # to a new remote repository (/new remote origin). | |
| # Here are a simple and quick steps that does exactly this. | |
| # | |
| # Let's assume we call "old repo" the repository you wish | |
| # to move, and "new repo" the one you wish to move to. | |
| # | |
| ### Step 1. Make sure you have a local copy of all "old repo" | |
| ### branches and tags. |
This file contains hidden or 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
| //Give level and quantity of dragon you want to merge | |
| //Calculate number of level 1 dragon you need to reach it. | |
| //Knowning merging 3 lower level dragons will get 1 dragon which has higher 1 level. | |
| //Merging 5 lower level will get 2 dragons which have higher 1 level. | |
| function numOfDragon(level, quantity) { | |
| if(level == 0) return 0; | |
| else if(level == 1) return 1 * quantity; | |
| if(quantity % 2 == 0) { | |
| return numOfDragon(level - 1, quantity / 2 * 5); | |
| } |
This file contains hidden or 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
| /// <summary> | |
| /// Initializes a new instance of the <see cref="WebHostBuilder"/> class with pre-configured defaults. | |
| /// </summary> | |
| /// <remarks> | |
| /// The following defaults are applied to the returned <see cref="WebHostBuilder"/>: | |
| /// use Kestrel as the web server and configure it using the application's configuration providers, | |
| /// set the <see cref="IHostingEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/>, | |
| /// load <see cref="IConfiguration"/> from 'appsettings.json', | |
| /// load <see cref="IConfiguration"/> from User Secrets when <see cref="IHostingEnvironment.EnvironmentName"/> is 'Development' using the entry assembly, | |
| /// load <see cref="IConfiguration"/> from environment variables, |
This file contains hidden or 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
| +graph;net_graphproportionalfont "0" | |
| cl_crosshairalpha "200";cl_crosshaircolor "4";cl_crosshaircolor_b "50";cl_crosshaircolor_r "50";cl_crosshaircolor_g "250";cl_crosshairdot "1";cl_crosshairgap "-1";cl_crosshairsize "2";cl_crosshairstyle "2";cl_crosshairusealpha "1";cl_crosshairthickness "1";cl_fixedcrosshairgap "-1";cl_crosshair_outlinethickness "0";cl_crosshair_drawoutline "1"; |
This file contains hidden or 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
| # If you come from bash you might have to change your $PATH. | |
| # export PATH=$HOME/bin:/usr/local/bin:$PATH | |
| # Path to your oh-my-zsh installation. | |
| export ZSH=/Users/quytruong/.oh-my-zsh | |
| export NVM_DIR="$HOME/.nvm" | |
| . "$(brew --prefix nvm)/nvm.sh" | |
| export PATH="$HOME/.composer/vendor/bin:/usr/local/sbin:$PATH" |
This file contains hidden or 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 getInRangedValue = function(value, min, max) { | |
| return value < min ? min : value > max ? max : value; | |
| } | |
| const pagination = function(current, visible, total) { | |
| const middle = Math.ceil(visible / 2); | |
| let startPage = current - middle + 1, endPage = startPage + visible; | |
| startPage = getInRangedValue(startPage, 1, total - visible + 1); | |
| endPage = getInRangedValue(endPage, visible, total); | |
| let pages = []; | |
| for(let i = startPage; i <= endPage && pages.length < visible; i++) { |
This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12
- Installing Homebrew is effortless, open Terminal and enter :
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :
This file contains hidden or 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
| 1. Stop mysql: | |
| systemctl stop mysqld | |
| 2. Set the mySQL environment option | |
| systemctl set-environment MYSQLD_OPTS="--skip-grant-tables" | |
| 3. Start mysql usig the options you just set | |
| systemctl start mysqld | |
| 4. Login as root |