Skip to content

Instantly share code, notes, and snippets.

@calimaborges
calimaborges / readme.md
Last active September 5, 2024 20:37
Curl Examples

curl examples

Usefull for REST

GET

curl -i -H "Accept: application/json" http://192.168.0.165/persons/person/1  
@calimaborges
calimaborges / readme.md
Created March 10, 2016 16:10
Steps to create new project
  • Create GitHub repo (tell it to create the README.md and the .gitignore to proper language)
  • Clone de repo in your development environment
  • npm init the repo
  • Commit the repo
  • Integrate Travis CI
  • Integrate Code Climate
  • Add Code Coverage from Code Climate
  • Update README.md with badges
@calimaborges
calimaborges / readme.md
Last active March 9, 2016 04:46
PHP + Laravel + Mac Configurations

PHP

Diretório onde será instalado: /usr/local/php5-*

Referência: http://php-osx.liip.ch/

Comando:

curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6
alias __git_ps1="git branch 2>/dev/null | grep '*' | sed 's/* \(.*\)/(\1)/'"
export CLICOLOR=1
#export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
export LSCOLORS=ExFxCxDxBxegedabagacad
RESET="\[\017\]"
NORMAL="\[\033[0m\]"
USER_COLOR="\[\033[1;32m\]"
DIR_COLOR="\[\033[1;35m\]"
GIT_COLOR="\[\033[1;33m\]"
@calimaborges
calimaborges / cocoonjs-extended-facebook.js
Created August 27, 2014 05:08
Cocoon Facebook Work In Progress
if (!(typeof window.CocoonJS === 'undefined' || window.CocoonJS === null)) { // BEGIN - CHECK FOR COCOONJS
(function() {
// The CocoonJS and CocoonJS.Social must exist before creating the extension.
if (typeof window.CocoonJS === 'undefined' || window.CocoonJS === null) throw("The CocoonJS object must exist and be valid before creating the extension types.");
if (typeof window.CocoonJS.Social === 'undefined' || window.CocoonJS.Social === null) throw("The CocoonJS.Social object must exist and be valid before creating the extension types.");
/**
* @class
* @constructor
* Represents a type that mimics the original Facebook API with the addition of the possibility to
@calimaborges
calimaborges / combinatorial-analysis.js
Last active December 1, 2021 10:56
Array combinations, permutations and arrangements
// permutation: Permutação
// P(n) = n!
// Exemplo: número de anagramas da palavra LIVRO = P(5) = n!
// Possibilidades de uma fila de 25 pessoas = P(25) = 25!
// combination: Combinação
// C(p,n) = = n! / p!(n - p)!
// Exemplo: formar comissão de 3 pessoas escolhidas entre 10 pessoas. C(3,10) = 10! / 3!(10 - 3)!
// arrangement: Arranjo
@calimaborges
calimaborges / laravel.md
Last active December 28, 2015 04:09
Laravel helpful snippets

Create project

composer create-project laravel/laravel project-name
@calimaborges
calimaborges / Vagrantfile
Last active December 20, 2015 08:59
Vagrant file
Vagrant.configure("2") do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://**/vagrant/boxes/precise32.box"
config.vm.synced_folder ".", "/vagrant", :id => "vagrant-root", :owner => "www-data", :group => "www-data"
config.vm.provision :shell, :path => "vagrant/bootstrap.sh"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.network :private_network, ip: "127.0.0.1"
config.vm.hostname = "localhost.projeto"
config.hostsupdater.aliases = ["dev.projeto"]
end
@calimaborges
calimaborges / vagrant_config.md
Last active December 19, 2015 13:59
Configuring vagrant to redirect 80 to 8080