docker kill $(docker ps -q)
docker rm $(docker ps -a -q)
docker rmi $(docker images -q)
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "os" | |
| ) |
| [user] | |
| name = Victor Benarbia | |
| email = victor.benarbia@arm.com | |
| [push] | |
| default = simple | |
| [alias] | |
| ci = commit | |
| ll = log --graph --stat --abbrev-commit --decorate=full | |
| lp = log --graph --patch --abbrev-commit --decorate=full | |
| lm = log --graph --patch --abbrev-commit --decorate=full --author victor |
| # 0. Shortcuts. | |
| CTRL+A # move to beginning of line | |
| CTRL+B # moves backward one character | |
| CTRL+C # halts the current command | |
| CTRL+D # deletes one character backward or logs out of current session, similar to exit | |
| CTRL+E # moves to end of line |
| test: | |
| ruby -p -i.old -e '$$_.gsub!('name', "$$USER" )' *.v |
| #!/bin/bash | |
| cmd="sleep 5s" | |
| # Run a command | |
| nohup $cmd > /dev/null 2>&1 & | |
| pid=$! | |
| # Here is the process id | |
| echo $pid |
| # Walk a dependency graph | |
| # | |
| def walk(deps, available = []) | |
| # End condition | |
| return if deps.keys.size == available.size | |
| if available.size == 0 | |
| deps.each do |f, h| | |
| next if h[:visited] == true | |
| next if h[:includes].size > 0 |
| require 'logger' | |
| module Log | |
| class << self | |
| def log | |
| @logger ||= Logger.new($stdout) | |
| @logger.formatter = proc do |severity, datetime, progname, msg| | |
| if(@interceptors) | |
| @interceptors.each { |interceptor| | |
| interceptor.call(severity, msg) |
| # Ruby mongoDB map reduce | |
| # The mongoDB documentation missed totally to | |
| # describes a simple usage for map reduce in Ruby. | |
| # and the web is full of misleading example based on the previous API. | |
| # | |
| # This gist try to fill out the gap. | |
| # First please read https://docs.mongodb.org/manual/tutorial/map-reduce-examples/ | |
| # below it is a simple Ruby implementation. | |
| # | |
| # @doc https://docs.mongodb.org/manual/core/map-reduce/ |