Skip to content

Instantly share code, notes, and snippets.

View allanfreitas's full-sized avatar
🏠
Working from home

Allan Freitas allanfreitas

🏠
Working from home
View GitHub Profile
@allanfreitas
allanfreitas / example.html
Last active September 21, 2015 15:22 — forked from RDelorier/example.html
Vue js filter to use with select options
//js
users = [
{ name:'foo', id:1 },
{ name:'bar', id:2 },
{ name:'baz', id:3 }
];
//html
<select
v-model="user.id"
@allanfreitas
allanfreitas / global-homestead.sh
Created September 24, 2015 16:54 — forked from taylorotwell/global-homestead.sh
Global Homestead Without Composer
alias homestead='function __homestead() { (cd ~/Documents/Code/Homestead && vagrant $*); unset -f __homestead; }; __homestead'
# Usage
homestead up
homestead halt
# etc...
@allanfreitas
allanfreitas / 1.md
Created October 14, 2015 03:31 — forked from rogeriopradoj/1.md
Dicas de como contribuir com open source by @rogeriopradoj

Olá, vamos para algumas dicas de como contribuir com opensource!

Procure seguir o fluxo base que o GitHub ensina para nós

O pessoal do GitHub tem um guia que ensina o GitHub flow, https://guides.github.com/introduction/flow/. A base que ele nos ensina é:

  • crie um branch para a alteração que você vai fazer
  • faça os commits (ou o commit único) das suas alterações
  • abra o pull request
# php7-fpm - The PHP FastCGI Process Manager
# Original script by Ondřej Surý. Adapted to php7-fpm by @bjornjohansen
description "The PHP FastCGI Process Manager"
author "Ondřej Surý <ondrej@debian.org>"
start on runlevel [2345]
stop on runlevel [016]
# Precise upstart does not support reload signal, and thus rejects the
#!/bin/sh
### BEGIN INIT INFO
# Provides: php-fpm php7-fpm
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts php7-fpm
# Description: Starts The PHP FastCGI Process Manager Daemon
### END INIT INFO
@allanfreitas
allanfreitas / externalize.sh
Last active April 2, 2016 20:29 — forked from vfonic/externalize.sh
externalize.sh
#!/bin/bash -e
function externalize_git {
if [ ! -d "$git_repos_repo_full_path" ]; then
mkdir -p "$git_repos_repo_full_path"
mv .git "${git_repos_repo_full_path}"/.git
git --git-dir="${git_repos_repo_full_path}/.git" --work-tree=. init && echo "gitdir: ${git_repos_repo_full_path}/.git" > .git
else
echo "Directory $git_repos_repo_full_path already exists!"
fi
@allanfreitas
allanfreitas / 0_reuse_code.js
Created April 2, 2016 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@allanfreitas
allanfreitas / dashboard.html
Created April 2, 2016 21:21 — forked from robinwarren/dashboard.html
Trello dashboard using Bootstrap and JQuery
<html>
<head>
<title>A Trello Dashboard</title>
<link rel="stylesheet" media="screen" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>Trello Dashboard</h1>
<form class="form-horizontal" id="boards_form">
@allanfreitas
allanfreitas / trello-to-newsletter.py
Created April 3, 2016 22:54 — forked from jefftriplett/trello-to-newsletter.py
Trello to Newsletter builder
"""
Trello to Newsletter builder
This is heavily inspired by: https://changelog.com/trello-as-a-cms/
To install:
pip install click cached_property markdown py-trello
To run:
export TRELLO_APP_KEY=''
@allanfreitas
allanfreitas / redis-delkeys.sh
Last active April 5, 2016 22:11 — forked from jdp/redis-delkeys.sh
Delete keys matching a pattern from Redis
#!/bin/sh
#
# Usage: ./redis-delkeys.sh [-h host] [-p port] [-n db] pattern
#
# Matches keys with the KEYS command matching pattern
# and deletes them from the specified Redis DB.
set -e
HOST="localhost"