Skip to content

Instantly share code, notes, and snippets.

View alexandrebini's full-sized avatar

Alexandre Bini alexandrebini

View GitHub Profile
@alexandrebini
alexandrebini / product_policies.go
Created February 27, 2018 16:32
product_policies.go
package research
import "fmt"
// ProductPolicies structure
type ProductPolicies []func(product Product) (Product, error)
const maxBSR = 200000
// CreateProductPolicies defines all the product policies
Bini
Nayara
Sys
Renata
Tadao
Luana
Tegon
Dudu
Azeitona
Teti
@alexandrebini
alexandrebini / # go - 2016-08-02_11-38-41.txt
Created August 2, 2016 14:39
go on Mac OS X 10.12 - Homebrew build logs
Homebrew build logs for go on Mac OS X 10.12
Build date: 2016-08-02 11:38:41
{"result":[{
"id": 1381,
"name": "Conecta",
"default": false,
"total_users": 79,
"category_ids": []
}, {
"id": 1382,
"name": "Alunos EAD",
"default": false,
# Git branch
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/(\1$(parse_git_dirty))/"
}
export PS1='\[\e[1;37m\]\w\[\e[m\] $(parse_git_branch "(%s)" ) \[\e[1;32m\]\$ \[\e[m\]\[\e[1;37m\]'
@alexandrebini
alexandrebini / 0_reuse_code.js
Last active August 29, 2015 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
#For jpeg files
#Need to install jpegtran in ubuntu
sudo apt-get install libjpeg-progs
Usage tips:
#To optimise a single jpeg image:
jpegtran -copy none -optimise -outfile image.jpg image.jpg
#To optimise all jpegs in the current directory:
for img in `ls *.jpg`; do jpegtran -copy none -optimise -outfile $img $img; done
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/(\1$(parse_git_dirty))/"
}
export PS1='\[\e[1;37m\]\w\[\e[m\] $(parse_git_branch "(%s)" ) \[\e[1;32m\]\$ \[\e[m\]\[\e[1;37m\]'
export EDITOR=nano
App.Router.reopen
location: 'history'
enableLogging: true
App.Router.map ->
@resource 'admin', ->
@resource 'wallpapers', ->
@route 'new'
App.AdminRoute = Ember.Route.extend
!!! 5
%html
%head
%title= "Your Website"
%meta{ :content => "", :name => "description" }
%meta{ :content => "", :name => "author" }
%meta{ :content => "3 days", :name => "revisit-after" }
%link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" }
%link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" }
%link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" }