Skip to content

Instantly share code, notes, and snippets.

View felixcarmona's full-sized avatar

Felix Carmona felixcarmona

View GitHub Profile
@felixcarmona
felixcarmona / Makefile
Created April 28, 2018 08:27
dockerized nginx-proxy (with letsencrypt ssl)
nginx-proxy-start:
docker run -d --restart=always --net=host -p 80:80 -p 443:443 -v $(dir $(abspath $(lastword $(MAKEFILE_LIST))))certs:/etc/nginx/certs:ro -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy
nginx-proxy-stop:
docker rm $$(docker stop $$(docker ps -a -q --filter ancestor=jwilder/nginx-proxy --format="{{.ID}}"))
nginx-proxy-restart:
-make nginx-proxy-stop
make nginx-proxy-start
@felixcarmona
felixcarmona / performWhen.js
Last active August 29, 2015 14:06
performWhen
define([], function () {
return function (task_closure, condition_closure, timeout_function) {
var itself = function () {
timeout_function(function () {
if (condition_closure()) {
task_closure();
} else {
itself();
}
}, 100);
@felixcarmona
felixcarmona / output_test_case.py
Last active August 29, 2015 14:06
Assert Ouput in python test
from unittest import TestCase
import sys
from StringIO import StringIO
class OutputTestCase(TestCase):
def assertOutput(self, expected_output):
return _AssertOutputContext(expected_output, self)
@felixcarmona
felixcarmona / phpunit.rb
Last active December 20, 2015 20:48 — forked from funkytaco/phpunit.rb
require 'formula'
class Phpunit < Formula
homepage 'http://www.phpunit.de/manual/current/en/index.html'
url 'http://pear.phpunit.de/get/phpunit.phar'
sha1 'de677ba60b2ccd135002d02501cde16a471503f5'
version 'HEAD'
def install
bin.install "phpunit.phar" => "phpunit"