View clean_remote_branches.sh
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
#!/bin/bash | |
# pick only branch name | |
awk -F"\torigin/" '{print $NF}' branches.txt > branches_trancated.txt | |
# Make it a space seperated single line | |
awk '$1=$1' ORS=' ' branches_trancated.txt > branches_space.txt | |
# cleanup | |
rm -f branches.txt branches_trancated.txt |
View get_own_branches.sh
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
#!/bin/bash | |
GREEN='\033[0;32m'; | |
NC='\033[0m'; | |
nameFromConfig=`git config --global user.name`; | |
echo Enter your git name [$nameFromConfig]: | |
read name | |
if [ -z "$name" ] | |
then | |
name=${nameFromConfig} |
View docker-compose.yml
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
version: "3.0" | |
services: | |
webapp: | |
build: | |
context: ../webapp | |
volumes: | |
- ../webapp:/usr/src/app | |
links: |
View Dockerfile
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 node:carbon | |
# Create app directory | |
RUN mkdir -p /usr/src/app | |
RUN chmod -R 777 /usr/src/app | |
WORKDIR /usr/src/app | |
# Copy code | |
COPY package.json /usr/src/app/ |
View script.sh
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
brew install dnsmasq | |
sudo echo 'address=/.test/127.0.0.1' >> /usr/local/etc/dnsmasq.conf | |
sudo mkdir -p /etc/resolver | |
echo 'nameserver 127.0.0.1' | sudo tee /etc/resolver/test | |
sudo brew services restart dnsmasq |
View compose.2.yml
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
version: '3' | |
services: | |
server1: | |
image: httpd:alpine | |
environment: | |
- VIRTUAL_HOST=server1.test | |
server2: | |
image: httpd:alpine | |
environment: | |
- VIRTUAL_HOST=server2.test |
View compose.1.yml
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
version: '3' | |
services: | |
server1: | |
image: httpd:alpine | |
ports: | |
- 8080:80 | |
server2: | |
image: httpd:alpine | |
ports: | |
- 8081:80 |
View webpack.config.js
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 path = require('path'); | |
const paths = { | |
BUILD: path.resolve(__dirname, 'build'), | |
SRC: path.resolve(__dirname, 'src') | |
}; | |
module.exports = { | |
entry: path.join(paths.SRC, 'app.js'), | |
output: { |
View Dijkstra.js
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
/** | |
* Basic Graph data structure implementation | |
* @constructor | |
*/ | |
var Graph = function() { | |
this.vertices = {}; | |
}; | |
Graph.prototype.add = function(name, edges) { | |
edges = edges || null; |
View git-branches-by-commit-date.sh
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
# Credit http://stackoverflow.com/a/2514279 | |
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ai %ar by %an" $branch | head -n 1` \\t$branch; done | sort -r |
NewerOlder