Skip to content

Instantly share code, notes, and snippets.

- Clona branch específico do repositório
$ git checkout -b experimental origin/experimental
- Apaga branch do repositório
git push <repository> :<branch>
removes a branch from a remote repository.
Example: git push origin :old_branch_to_be_deleted
- Ignora todas as alterações feitas em um branch:
git checkout -f
@taiar
taiar / qrI.c
Created May 7, 2011 14:24
GCJ #1
/*
* qr.c
*
* Created on: 07/05/2011
* Author: taiar
*/
#include <stdio.h>
#include <stdlib.h>
/**
* Subsets
*
* 10 Jun 2010
*
* This is a try for an efficient way to generate all the subsets of a set of
* integers.
*
* Andre Taiar < taiar ( ao ) hotmail com >
*/
program entrada
! quantidade de dados da entrada, indices
integer n, i
! vetor de abcissas, vetor de ordenadas
real x(99), y(99)
! coeficiente de inclinacao da reta, termo independente
real a, b
! somatorio de Xi, somatorio de Yi, somatorio de XiYi, somatorio do
! quadraro de Xi
@taiar
taiar / CreateXPDOClasses.php
Created January 11, 2012 16:23
XPDO Classes 'Reverse Engineered' From Database
<?php
/**
* @package = CreateXpdoClasses
*
* Create Xpdo Classes script
*
* This script creates xPDO-ready classes from existing custom
* database tables. It only needs to be run once.
*
* It assumes that your custom tables have been imported into
@taiar
taiar / taiar.sublime-snippet.xml
Created March 29, 2012 19:00
My Sublime Text 2 snippets
<snippet>
<content><![CDATA[\$${1:this}->$2]]></content>
<tabTrigger>th</tabTrigger>
<scope>source.php</scope>
</snippet>
@taiar
taiar / pre-commit.sh
Created April 2, 2012 20:37
git hook para dump do database antes de comittar
#!/bin/sh
#
# To enable this hook, rename this file to "pre-commit".
/c/Program\ Files/MySQL/MySQL\ Server\ 5.5/bin/mysqldump.exe --add-drop-table -h localhost -u root -ptaiar taghouse > database/dump.sql
@taiar
taiar / .htaccess
Created April 19, 2012 21:16
Codeigniter root.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
########### TODO: deploying on subdir must rewrite this
RewriteBase /subdir/
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
@taiar
taiar / findtodo.sh
Created May 30, 2012 23:48
Procura TAGS todo no diretório corrente
find ./ -type f | xargs grep TODO
@taiar
taiar / load.sublime-snippet.xml
Created May 31, 2012 21:54
Sublime Text 2 Codeigniter load snippet
<snippet>
<content><![CDATA[\$${1:this}->load->${2:helper}('$4');]]></content>
<tabTrigger>load</tabTrigger>
</snippet>