Skip to content

Instantly share code, notes, and snippets.

@mpneuried
mpneuried / Makefile
Last active May 4, 2024 13:46
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@ColCh
ColCh / README.md
Last active April 5, 2022 12:06
Create merge request on Gitlab in command line for current branch

Gitlab merge request script

Creates merge request on Gitlab for you

Installation

Download it, add executable perms and place into PATH:

# Place it into ~/.bin
mkdir ~/.bin
@davidderus
davidderus / .dockerignore
Last active March 3, 2024 10:15
Docker + Rails + Puma + Postgres + Nginx
.git
.gitignore
/doc
.yardoc
coverage
jsdoc
/tmp
/log
Dockerfile
Dockerfile.prod
@bsdshell
bsdshell / shellcolor.sh
Last active June 28, 2017 20:07
shell color shell script color console color
## Colours and font styles
## Syntax: echo -e "${FOREGROUND_COLOUR}${BACKGROUND_COLOUR}${STYLE}Hello world!${RESET_ALL}"
# Escape sequence and resets
ESC_SEQ="\e[0;"
RESET_ALL="${ESC_SEQ}0m"
RESET_BOLD="${ESC_SEQ}21m"
RESET_UL="${ESC_SEQ}24m"
# Foreground colours
FG_BLACK="${ESC_SEQ}30m"
#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
@ibanez270dx
ibanez270dx / gradient_generator.rb
Last active June 20, 2019 09:09
Ruby Gradient Generator
#####################################################################################
# gradient.rb 11.29.2014
#
# Ruby Gradient Generator
# author: Jeff Miller
# website: humani.se
# github: github.com/ibanez270dx
#
# USAGE:
# Enter RGB or Hex color values and number of steps
@augcesar
augcesar / inflections.rb
Created October 20, 2014 18:15
Inflector pt-BR
ActiveSupport::Inflector.inflections do |inflect|
inflect.clear
inflect.plural(/$/, 's')
inflect.plural(/(s)$/i, '\1')
inflect.plural(/^(paí)s$/i, '\1ses')
inflect.plural(/(z|r)$/i, '\1es')
inflect.plural(/al$/i, 'ais')
inflect.plural(/el$/i, 'eis')
inflect.plural(/ol$/i, 'ois')
@Jokymon
Jokymon / crossbuild_qt5_for_rpi.sh
Last active December 30, 2018 07:59
Protocol from Cross compiling Qt5 for Raspberry Pi
set -e
PREFIX=~/opt/qt5pi
ROOTFS_MOUNT=/mnt/rasp-pi-rootfs
# On Ubuntu 14.04 do the following first to get the ia32-lib
if [ `lsb_release -ds` -eq "Ubuntu 14.04 LTS" ]
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
fi
@rubencp
rubencp / Gemfile
Created September 6, 2014 09:50
Override Confirm dialog Rails 4 and Bootbox.js
gem 'bootbox-rails', '~>0.3'
@jackkinsella
jackkinsella / delayed_job_config.rb
Created May 16, 2014 14:13
Delayed Job Background Notification modification
# copy to: config/initializers/delayed_job_config.rb
# Fail at startup if method does not exist instead of later in a background job
[[ExceptionNotifier::Notifier, :background_exception_notification]].each do |object, method_name|
raise NoMethodError, "undefined method `#{method_name}' for #{object.inspect}" unless object.respond_to?(method_name, true)
end
# Chain delayed job's handle_failed_job method to do exception notification
Delayed::Worker.class_eval do
def handle_failed_job_with_notification(job, error)