Skip to content

Instantly share code, notes, and snippets.

View fredericobenevides's full-sized avatar

Frederico Benevides fredericobenevides

View GitHub Profile
@fredericobenevides
fredericobenevides / slim.rb
Created March 8, 2014 13:46
Override the Slim parser to add default whitespace for some tags.
# Override the Slim parser to add default whitespace for some tags.
module Slim
class Parser < Temple::Parser
alias :old_parse_tag :parse_tag
WHITESPACE_MODIFIER = '<'
TAGS_TO_ADD_WHITESPACE = %w[. # div span]
def parse_tag(tag)
.cubo {
transform-style: preserve-3d;
position: relative;
top: 100px;
left: 100px;
transform: rotateX(10deg) rotateY(10deg);
}
.face {
position: absolute;
@fredericobenevides
fredericobenevides / oci8.pc
Created April 29, 2016 20:01
Setup for go-oci8
prefix=/opt/oracle
includedir=${prefix}/instantclient_12_1/sdk/include
libdir=${prefix}/instantclient_12_1
Name: oci8
Description: Oracle Instant Client
Version: 12.1
Cflags: -I${includedir}
Libs: -L${libdir} -lclntsh
@fredericobenevides
fredericobenevides / reload_page.js
Created April 7, 2017 18:15
Reload the page to not kill the session using GreaseMonkey
var id = reloadPage();
document.body.addEventListener("mouseover", function() {
clearInterval(id);
id = reloadPage();
})
function reloadPage() {
var id = setInterval(function() {
location.reload();
@fredericobenevides
fredericobenevides / tensorflow_1.6_with_gpu.md
Last active March 9, 2018 00:28
Tensorflow 1.6 with GPU on macOs High Sierra 10.13.3
@fredericobenevides
fredericobenevides / signal.go
Created April 1, 2019 06:02 — forked from reiki4040/signal.go
signal handling example for golang
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
)
func main() {
@fredericobenevides
fredericobenevides / multiple-deploy-keys-multiple-private-repos-github-ssh-config.md How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

Let's say alice is a github.com user, with 2 or more private repositories repoN. For this example we'll work with just two repositories named repo1 and repo2

https://github.com/alice/repo1

https://github.com/alice/repo2

You need to be to pull from these repositories without entering a passwords probably on a server, or on multiple servers. You want to perform git pull origin master for example, and you want this to happen without asking for a password.

@fredericobenevides
fredericobenevides / docker-compose.yml
Created October 24, 2019 18:15 — forked from mhowlett/docker-compose.yml
Brings up a kafka cluster using Docker for Mac. Usage: MY_IP=<your ip> docker-compose up
---
version: '2'
services:
zk1:
image: confluentinc/cp-zookeeper:3.0.1
ports:
- "22181:22181"
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_CLIENT_PORT: 22181