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

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>comment</key>
<string>
TODO: unresolved issues
text:
# config/initializers/char_converter.rb
require 'uri'
module Support
class CharConverter
def initialize(app)
@app = app
end
@ppdeassis
ppdeassis / tomcat6
Created February 18, 2014 23:50 — forked from willnet/tomcat6
#!/bin/bash
# description: Tomcat6 service
# processname: java
# chkconfig: - 99 1
# Source function library.
. /etc/init.d/functions
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre
export TOMCAT_USER=solr
export CATALINA_HOME=/opt/tomcat6
@ppdeassis
ppdeassis / homebrew
Last active December 17, 2015 08:18 — forked from gcatlin/gist:1847248
Install a specific formula with Homebrew package manager, or change versions...
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#