Skip to content

Instantly share code, notes, and snippets.

View brpaz's full-sized avatar

Bruno Paz brpaz

View GitHub Profile
@thisismitch
thisismitch / haproxy-www.tf
Last active March 6, 2020 02:22
How To Use Terraform with DigitalOcean
resource "digitalocean_droplet" "haproxy-www" {
image = "ubuntu-14-04-x64"
name = "haproxy-www"
region = "nyc2"
size = "512mb"
private_networking = true
ssh_keys = [
"${var.ssh_fingerprint}"
]
connection {
@jakzal
jakzal / TestDataBuilder.php
Last active April 26, 2023 20:37
Test data builder
<?php
namespace Acme\Builder;
class TestDataBuilder
{
/**
* @var array
*/
protected $defauts = [];
@jaimegago
jaimegago / gist:11229750
Last active October 23, 2022 23:31
Grafana Dashboards Backups
#!/usr/bin/python -tt
#
import datetime
import json
import logging
import logging.handlers
import optparse
import os
import re
import shutil
@vaskoz
vaskoz / builder.go
Last active January 22, 2024 10:54
Golang Builder pattern
package main
import "strconv"
import "fmt"
type Color string
type Make string
type Model string
const (
@nkwhr
nkwhr / partition.rb
Last active February 2, 2022 13:55
a serverspec resource type for checking partitions.
module Serverspec
module Type
class Partition < Base
def initialize(partition, type)
@name = partition
@partition_table = {}
case type
when 'cylinder'
options = "-l"
@agendor
agendor / hapijs-rest-api-tutorial.md
Last active August 31, 2021 08:31
A practical introduction to building a RESTful API with the hapi.js server framework for Node.js
@trdarr
trdarr / hubot-digitalocean.md
Last active March 28, 2022 20:34
Deploying Hubot on DigitalOcean (with Slack integration)
@sandfox
sandfox / app.js
Created February 19, 2014 23:57
too simple express/restify/whatever controller + routemap example
var express = require('express');
var blahController = require('./example-controller'); //and so on and so forth
var routes = require('./routes');
var app = express()
var controllers = {
blah: blahController,
user: userController
}
@hiroakis
hiroakis / Rakefile_serverspec
Last active June 5, 2016 21:27
serverspec for my environment
require 'rake'
require 'rspec/core/rake_task'
require 'yaml'
require 'highline/import'
properties = YAML.load_file('properties.yaml')
ENV['SSH_USER'] = ask("Enter ssh user: ") { |q| q.echo = true }
ENV['SSH_PASSWORD'] = ask("Enter ssh password: ") { |q| q.echo = false }
@branneman
branneman / better-nodejs-require-paths.md
Last active April 11, 2025 10:39
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