Skip to content

Instantly share code, notes, and snippets.

@marabesi
marabesi / gist:d1ba13e832ce53e8ac73
Created June 5, 2014 11:16
Understanding the language with objects and prototype
function DebugConsole() {
var consoleElem = document.createElement('div');
consoleElem.id = "debug";
document.body.appendChild(consoleElem);
this.shaded = false;
}
DebugConsole.prototype.displayMsg = function(msg) {
@marabesi
marabesi / Bitwise operation examples
Last active August 29, 2015 14:16
Example how to use the bitwise operators in a easy way
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | = 255 // just sum all the possible bit values in the table
| | | | | | | |
0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | = 10 // Representation of the 10 in bit
1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | = 192 // Representation of the 192 in bit
AND (&) Operator (7 & 9) The bits must be active in either rows
0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | = 7
0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | = 9
@marabesi
marabesi / simplest-phing-build.xml
Last active September 16, 2015 11:02
Simples build.xml you can have to run Phing
<?xml version="1.0" encoding="utf-8"?>
<project name="Basic Task" default="dist">
<target name="dist">
</target>
</project>
@marabesi
marabesi / build-file-example.xml
Created September 30, 2015 01:17
Simple build file to run with Phing within three targets
<?xml version="1.0" encoding="utf-8"?>
<project name="First Example" description="Clone, phpunit" default="phpunittests">
<property name="appdir" value="."/>
<property name="repodir" value="./app"/>
<property name="testdir" value="./app/tests"/>
<property name="repo" value="https://github.com/marabesi/laravel-pagseguro.git" />
<target name="clone">
<echo msg="Cloning repository ${repo} please wait"/>
<gitclone repository="${repo}" targetPath="${appdir}/app"/>
@marabesi
marabesi / iterm2.md
Created October 1, 2016 14:23
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [
CREPUBLICA FEDERATIVA DO BRASIL ESTADO DE SAO PAULO SECRETARIA DE ESTADO DE SEGURANCA PUBLICA POLICIA civi SPTCIDEPARTAMENTO DEIDENTIFICACAO ASSINATURA DO TITULAR CARTEIRA DE IDENTIDADE o THOMAS GREGG SONS ORRES o VALIDA EM TODO OTERRITORIO NACIONAL O O DATA D 31/02/1990 0.531.915 -12-1 EXPED NOME FRANCISCO DE ASSIS PEREIRA MARIA HELENA PEREIRA NELSON PEREIRA DATA DE NASCIMENTO NATURALIDADE 07-12-1970 CAMPINAS SP Doc, ORIGEM C.CAS 021897.01. 44.1990.0000 6-18 4.000 137 4.42 CAMPINAS SP CPF 041-437-591-11 ASSINATURA DO DIRETOR 3 LEI No 7.116 DE 29/08/88 So THOMAS QAEO SONN
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Running provisioner: file...
==> default: Running provisioner: shell...
default: Running: inline script
==> default: Running provisioner: shell...
default: Running: inline script
==> default: Running provisioner: shell...
default: Running: /tmp/vagrant-shell20161202-28005-1pu4aen.sh
==> default: Running provisioner: shell...
@marabesi
marabesi / atom-packages.sh
Created January 25, 2017 14:23
Atom packages
# file icons
apm install file-icons &&
# allow to move between panes
apm install move-panes &&
# allow debug php from atom
apm install php-debug &&
# allo using terminal inside atom
@marabesi
marabesi / query-builder.php
Created June 17, 2017 16:31
Query builder - is it possible to test it?
<?php
namespace App\Repositories;
use DB
class MyRepository
{
public function getAllAmountsByProduct(array $revenueTable, $sRevColumns, $sCompanyID)
set -g default-terminal "screen-256color"