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 / 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 / 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 / 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
#!/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
# 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ý <[email protected]>"
start on runlevel [2345]
stop on runlevel [016]
# Precise upstart does not support reload signal, and thus rejects the
@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
@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 / 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"
$res = $conn->query('
SET @num := 0, @genre := "";
SELECT
id_artista,
artista,
art_url,
genero_url,
genero,
(
#!/bin/env python
import timeit
loops = 1000
setup = """
import MySQLdb
db = MySQLdb.connect(host="remotedb.example.com",
read_default_file="/root/.my.cnf",