Skip to content

Instantly share code, notes, and snippets.

@ppdeassis
ppdeassis / Dockerfile
Created November 27, 2019 12:57 — forked from gottfrois/Dockerfile
medium-multi-stage-dockerfile-final-dockerfile
###############################
# Stage wkhtmltopdf
FROM madnight/docker-alpine-wkhtmltopdf as wkhtmltopdf
######################
# Stage: ruby
FROM ruby:2.5.1-alpine3.7 as ruby
LABEL description="Base ruby image used by other stages"
######################
@ppdeassis
ppdeassis / os-x-update-tzdata.sh
Last active October 22, 2019 16:36 — forked from tgirardi/os-x-update-tzdata.sh
Update tzdata and ICU data on OS X to fix problems with outdated DST information (needs reboot)
#!/bin/bash
# author: Pedro de Assis
# Based on Tomás Girardi
# Based on http://helw.net/2011/04/28/updating-osx-for-egypts-dst-changes/ by Ahmed El-Helw
set -ex
# CHANGE THIS:
# go to https://www.iana.org/time-zones and get the URL for the last DATA
# release
@ppdeassis
ppdeassis / better-nodejs-require-paths.md
Created August 17, 2018 19:11 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@ppdeassis
ppdeassis / macOS_setup.bash
Last active March 6, 2019 12:32
Setup dev environment on macOS
#!/bin/bash
#
# \curl https://gist.githubusercontent.com/ppdeassis/601d9191c76337b94909/raw/92f4af629ee7d8d58022c4711b77e1fbd0f560e4/ruby_osx_setup.sh | bash
#
# If any command fails, we should immediately fail too
set -e
#
#
BASH_PROFILE="$HOME/.profile"
@ppdeassis
ppdeassis / HOWTO_mailx.sh
Created June 30, 2016 17:50
Setting up mailx to send mail from command line using external server
# ref: https://coderwall.com/p/ez1x2w/send-mail-like-a-boss
# install mailx
yum -y install mailx
# create a directory with a certificate, to send mail using TLS
mkdir ~/.certs
certutil -N -d ~/.cert
# create a user ~/.mailrc, to use custom settings
@ppdeassis
ppdeassis / pre-commit
Last active July 20, 2022 22:30
Git pre-commit hook for a rails project. Add it to your `repo/.git/hooks/pre-commit` file and make sure it has +x permission.
#!/bin/bash
#
# install into git dir:
# curl \
# -fSL https://gist.githubusercontent.com/ppdeassis/48387d9f49b41af23e7d/raw/bfb0c8adb6fe57e965395dc2f4a6b3e6d0004128/pre-commit \
# -o .git/hooks/pre-commit \
# && chmod +x .git/hooks/pre-commit
#
#!/bin/bash
@ppdeassis
ppdeassis / sed_samples.sh
Created January 19, 2016 19:09
sed samples
# reference: http://stackoverflow.com/a/18840396
# portable across GNU and BSD - the -E option
sed -E 's/[[:space:]]?"[[:space:]]?//g' <path/to/file>
# NOTE the regex is just a sample
@ppdeassis
ppdeassis / sublime_plugins.txt
Last active March 6, 2019 12:33
Sublime plugin list
# package control - helps managing packages
https://packagecontrol.io
### Packages
- ayu (theme)
- click install file-icon pack
- Cmd + Shift + P -> ayu: Activate Theme -> ayu Mirage
- Babel
- Delete Current File
- Quick File Move
@ppdeassis
ppdeassis / .profile
Last active January 26, 2020 19:31
bash profile
# Tell ls to be colourful
export CLICOLOR=1
export LSCOLORS=Exfxcxdxbxegedabagacad
# Tell grep to highlight matches
export GREP_OPTIONS='--color=auto'
# ignore dupes on bash history
export HISTCONTROL=ignoredups
@ppdeassis
ppdeassis / ruby_osx_setup.sh
Last active May 10, 2017 03:42
Installing a Ruby workstations from scratch on OS X (last used on El Capitan)
#!/bin/bash
#
# \curl https://gist.githubusercontent.com/ppdeassis/601d9191c76337b94909/raw/92f4af629ee7d8d58022c4711b77e1fbd0f560e4/ruby_osx_setup.sh | bash
#
# If any command fails, we should immediately fail too
set -e
#
#