Skip to content

Instantly share code, notes, and snippets.

View tavlima's full-sized avatar

Thiago Lima tavlima

  • Recife, PE - Brazil
View GitHub Profile
@tavlima
tavlima / gist:4724533
Created February 6, 2013 18:08
Some git commands for future reference.
# "Merge" a single file from another branch (won't merge the history!!!)
$ git checkout BRANCH path/filename
# List the files changed between branches
$ git diff --name-status BRANCH_A BRANCH_B
@tavlima
tavlima / countries-iso-3166.php
Created February 14, 2013 20:35
Country names and two letters code (ISO 3166-1-alpha-2) Every word in country names begin with uppercase letters, except for prepositions and alike. From http://www.iso.org/iso/home/standards/country_codes/country_names_and_code_elements_txt.htm Last update: 2013-02-14
<?php
// From http://www.iso.org/iso/home/standards/country_codes/country_names_and_code_elements_txt.htm
// Last update: 2013-02-14
// Every word in country names begin with uppercase letters, except for prepositions and alike
$countries = array(
'AF' => "Afghanistan",
'AX' => "Åland Islands",
'AL' => "Albania",
@tavlima
tavlima / languages-iso-639-2.php
Created February 14, 2013 20:38
Languages and three letters code (ISO 639-2) Using only the bibliographic (B) codes From http://www.loc.gov/standards/iso639-2/php/code_list.php Last update: 2013-02-14
<?php
// From http://www.loc.gov/standards/iso639-2/php/code_list.php
// Last update: 2013-02-14
// Using only the bibliographic (B) codes
$languages = array(
'aar' => "Afar",
'abk' => "Abkhazian",
'ace' => "Achinese",
# Condensar os ultimos N commits em um so.
# Marque como "squash" os commits que devem ser
# integrados com o item anterior, na lista
git rebase -i HEAD~N
# Remover um branch remoto (a diferenca eh os ":")
# REMOTE eh seu repositorio remoto (origin, por exemplo)
# BRANCH eh o nome do branch que voce quer remover
git push REMOTE :BRANCH
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
timers: null,
// contrived examples are contrived, I used `init` because I know what I'm doing
initTimers: Ember.on('init', function() {
this.set('timers', [
@tavlima
tavlima / components.inner-component.js
Last active October 17, 2016 23:01
Events Playground
import Ember from 'ember';
export default Ember.Component.extend({
value: 0,
logger: "Default initial value",
_willRender: function() {
this.set('logger', this.get('logger') + '\nEVENT: willRender');
}.on('willRender')
});
@tavlima
tavlima / gist:c251183a34251bc4eba34034964fb142
Created November 28, 2016 20:03
Spring Boot Cloud Config (Zookeeper)
@SpringBootApplication
public class CloudExperimentApplication implements CommandLineRunner {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private Environment environment;
public static void main(String[] args) {
SpringApplication.run(CloudExperimentApplication.class, args);
import Ember from 'ember';
import DocCaixa from '../models/docCaixa';
export default Ember.Controller.extend({
appName: 'Boletos',
model: new DocCaixa(),
linhaInput: '',
actions: {
parseLinha: function() {
this.get('model').parseLinha(this.get('linhaInput'));