Skip to content

Instantly share code, notes, and snippets.

View fgbreel's full-sized avatar
🦆

Gabriel Francisco fgbreel

🦆
  • Berlin
View GitHub Profile
@fgbreel
fgbreel / build-php-zts.sh
Last active July 3, 2022 22:34
Build PHP7 with ZTS on Debian Stretch
#!/usr/bin/env bash
apt-get build-dep php7.0
mkdir ~/php7-amd64 && cd ~/php7-amd64
apt-get source php7.0
cd php7.0-7.0.19
# rename packages to *-zts
@fgbreel
fgbreel / Dockerfile
Last active April 4, 2017 20:12
A self registered micro service example from gomicro
FROM golang:onbuild
nginx:
pkg.installed
git-core:
pkg.installed
apt-transport-https:
pkg.installed
https://github.com/fgbreel/fabio.git:
#!/usr/bin/perl
use DBI;
# Connect to the local database
$dbh = DBI->connect('DBI:mysql:host=localhost;database=mysql', 'root', 'password') || die;
# Flush and lock tables to prepare for LVM snapshot
$dbh->do('FLUSH TABLES WITH READ LOCK;');

Keybase proof

I hereby claim:

  • I am fgbreel on github.
  • I am fgbreel (https://keybase.io/fgbreel) on keybase.
  • I have a public key whose fingerprint is 91F8 48A8 675F D254 5AFA 82F1 4DB1 3D91 2D3E 7517

To claim this, I am signing this object:

# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
@fgbreel
fgbreel / mask.rb
Created March 24, 2016 21:07 — forked from pgr0ss/mask.rb
def mask n;n.slice(0,6)+"*"*(n.size-10)+n.slice(-4,4);end
@fgbreel
fgbreel / bg-loader.js
Created March 18, 2016 17:50
JS ajax background loader
var post = {
init: function() { $('.post').on('click', this.loadPost); },
updatePost: function(result, event) {
var $post = $(event.currentTarget);
$post.fadeIn({
duration: 400,
start: function(){
$post.find('.post-title').text(result.title);
$post.find('.post-content').text(result.content);
@fgbreel
fgbreel / whisper-calculator.py
Created February 11, 2016 13:19 — forked from jjmaestro/whisper-calculator.py
whisper-calculator.py: Calculates the size of the whisper storage for the given retention (in frequency:history format)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def archive_to_bytes(archive):
def to_seconds(s):
SECONDS_IN_A = {
's': 1,
'm': 1 * 60,
'h': 1 * 60 * 60,
@fgbreel
fgbreel / unicorn
Last active February 2, 2016 22:01
unicorn lsb init script for huginn
#! /bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $syslog $networking
# Required-Stop: $syslog $networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Unicorn APP Server
# Description: Debian init script for the Unicorn APP Server
# scheduler