Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Rohit Joshi RohitRox

🎯
Focusing
View GitHub Profile
@RohitRox
RohitRox / readme.md
Created Oct 27, 2019 — forked from pdincau/readme.md
Study Path on microservices
View readme.md
@RohitRox
RohitRox / remove_ds_store_files.sh
Created Mar 25, 2019 — forked from jls/remove_ds_store_files.sh
Remove all of the .DS_Store files in the current directory and all sub directories.
View remove_ds_store_files.sh
find ./ -type f | grep .DS_Store | xargs rm
@RohitRox
RohitRox / find-ecr-image.sh
Created Feb 19, 2019 — forked from outofcoffee/find-ecr-image.sh
Check if Docker image exists with tag in AWS ECR
View find-ecr-image.sh
#!/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 )"
@RohitRox
RohitRox / clean-docker.sh
Created Nov 25, 2018 — forked from apmiller108/clean-docker.sh
Bash script to clean up docker
View clean-docker.sh
#!/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)
@RohitRox
RohitRox / attached_validator.rb
Created Sep 23, 2018 — forked from carlosramireziii/attached_validator.rb
A validator and RSpec matcher for requiring an attachment using Active Storage
View attached_validator.rb
class AttachedValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
record.errors.add(attribute, :attached, options) unless value.attached?
end
end
View ember.array_extensions.js.coffee
# 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
View pagination_overrides.scss
.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;
}
View gist:6163763
# .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
View gist:6055432

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...

View .bash_profile
# 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
You can’t perform that action at this time.