brew update
brew install dnsmasq
brew tap caskroom/cask
brew cask install virtualbox
brew cask install vagrant
brew cleanup
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/sh | |
| branch="$(git rev-parse --abbrev-ref HEAD)" | |
| # get computer name to append in Chime message | |
| username=$USER | |
| # a branch name where you want to prevent git push. In this case, it's "master" | |
| if [ "$branch" = "master" ]; then | |
| echo "You can't commit directly to '"${branch}"' branch" # webstorm or intellij will show this as popup |
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
| sed -i "/^uuid:/d;/^_core:/d;/^ default_config_hash:/d" * |
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/sh | |
| rsync -rP /Volumes/OP-Z/* ~/Music/OP-Z/Backups/$(date "+%Y-%m-%d_%H-%M-%S") |
Objective: Print the lyrics for the current playing song.
How: We'll create a small bash script to do the fetching for us (using curl) and then we'll
display it either in the terminal or in our $EDITOR
First we'll need to get the name of the current song and its artist:
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
| # crontab -l | |
| @daily /bin/bash ~/cron/db-backup.sh |
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
| <?php | |
| namespace Drupal\custom_module_name\Controller; | |
| use \Drupal\Core\Controller\ControllerBase; | |
| use \Drupal\Core\Site\Settings; | |
| use Drupal\node\Entity\Node; | |
| class CustomModuleController extends ControllerBase { | |
| private function appLibrary() { | |
| $isSandbox = Settings::get('is_sandbox', FALSE); // if not configured, set as false |
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
| ... | |
| ... | |
| providers: [ | |
| { provide: Http, useClass: ExtendedHttpService } | |
| ] | |
| ... | |
| ... |