This is study path related to microservices. It is not a study path on programming, if you want to improve in this sense please take a look at this.
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
find ./ -type f | grep .DS_Store | xargs rm |
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
#!/usr/bin/env bash | |
# Example: | |
# ./find-ecr-image.sh foo/bar mytag | |
if [[ $# -lt 2 ]]; then | |
echo "Usage: $( basename $0 ) <repository-name> <image-tag>" | |
exit 1 | |
fi | |
IMAGE_META="$( aws ecr describe-images --repository-name=$1 --image-ids=imageTag=$2 2> /dev/null )" |
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='\x1B[32m' | |
RED='\x1B[31m' | |
NOCOL='\x1B[39m' | |
echo "${GREEN}Removing exited containers${NOCOL}" | |
docker rm -v $(docker ps --filter status=dead --filter status=exited -aq) | |
echo "${GREEN}Removing dangling images${NOCOL}" | |
docker rmi $(docker images -f "dangling=true" -q) |
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
class AttachedValidator < ActiveModel::EachValidator | |
def validate_each(record, attribute, value) | |
record.errors.add(attribute, :attached, options) unless value.attached? | |
end | |
end |
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
# Sorts an array based on a property of each object within the array | |
# | |
# Examples: | |
# | |
# [Em.Object.create(a: 1), Em.Object.create(a: 5), Em.Object.create(a: 3)].sortProperty('a') | |
# > [{a: 1}, {a: 3}, {a: 5}] | |
# | |
# As a computed property: | |
# | |
# AC = Em.ArrayController.extend |
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
.pagination a, .pagination span.current, .pagination span.gap { | |
float: left; | |
padding: 0 14px; | |
line-height: 38px; | |
text-decoration: none; | |
background-color: white; | |
border: 1px solid #DDD; | |
border-left-width: 0; | |
} |
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
# .irbrc to log goodies like SQL/Mongo queries to $stdout if in Rails 3 console | |
if defined?(Rails) && Rails.respond_to?(:logger) | |
require 'logger' | |
Rails.logger = Logger.new($stdout) | |
if defined?(Mongoid) | |
Mongoid.logger = Rails.logger | |
end | |
end |
Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
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
# Only for Mac OS X, where .bashrc is otherwise ignored | |
if [ -f ~/.bashrc ]; then | |
source ~/.bashrc | |
fi | |
# MacPorts | |
export PATH=/opt/local/bin:/opt/local/sbin:$PATH | |
export MANPATH=/opt/local/share/man:$MANPATH |
NewerOlder