Skip to content

Instantly share code, notes, and snippets.

Suman Paul skeep

Block or report user

Report or block skeep

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
View clean_remote_branches.sh
#!/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
#!/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
version: "3.0"
services:
webapp:
build:
context: ../webapp
volumes:
- ../webapp:/usr/src/app
links:
View Dockerfile
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
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
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
version: '3'
services:
server1:
image: httpd:alpine
ports:
- 8080:80
server2:
image: httpd:alpine
ports:
- 8081:80
View webpack.config.js
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: {
@skeep
skeep / Dijkstra.js
Last active Aug 13, 2018
Dijkstra's algorithm is an algorithm for finding the shortest paths between nodes in a graph, which may represent, for example, road networks. It was conceived by computer scientist Edsger W. Dijkstra in 1956 and published three years later. This programme is an implementation of https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm#Pseudocode
View Dijkstra.js
/**
* Basic Graph data structure implementation
* @constructor
*/
var Graph = function() {
this.vertices = {};
};
Graph.prototype.add = function(name, edges) {
edges = edges || null;
@skeep
skeep / git-branches-by-commit-date.sh
Created May 26, 2016 — forked from l15n/git-branches-by-commit-date.sh
List remote Git branches and the last commit's author and author date for each branch. Sort by most recent commit's author date.
View git-branches-by-commit-date.sh
# 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
You can’t perform that action at this time.