Skip to content

Instantly share code, notes, and snippets.

View anselmobattisti's full-sized avatar
🇧🇷
Aqui é Brasil!

Anselmo Battisti anselmobattisti

🇧🇷
Aqui é Brasil!
View GitHub Profile
in main.js
import VueI18n from 'vue-i18n'
import lang from './language/lang'
const i18n = new VueI18n({
locale: 'pt-BR', // set locale
messages: lang // set locale messages
}
The code of component!
The impportant thing here is the event input, this name must be exactly this to vue handle the bind of value propoerty outside de component!
<template lang="html">
<div>
<div
id='on'
@click="switched(true)"
:class="{active: value}">On</div>
@anselmobattisti
anselmobattisti / gist:4461750
Created January 5, 2013 14:17
solucao do problema de soma 15 de forma aleatoria
class Cubo {
int[] num = {1,2,3,4,8,6,7,5,9};
int t = 0;
public static void main (String args[]){
new Cubo();
}
Cubo(){
function bannertracker(){
var aReturn=document.getElementsByTagName("A");
var c;
for (i=0;i<aReturn.length;i++) {
c=aReturn[i].getAttribute("href");
if (c.indexOf("submarin")>-1){
aReturn[i].onclick=function(){
pageTracker._trackPageview('/bannerads/submarino/banner');
};
}
# tira um print da tela e manda em anexo via e-mail
echo "Assunto:";
read ASSUNTO
echo "Destinatário";
read EMAIL
# gera o jpg da tela
import tela.jpg
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("language", "1");
function translate(palavra) {
google.language.translate(palavra, 'pt', 'en', function(result) {
if (result.translation) {
alert(result.translation);
}
/**
* somar_dias_uteis
*
* @abstract Soma dias úteis a uma data
*
* @param unknown_type $str_data data original
* @param unknown_type $int_qtd_dias_somar dias que serão somados
* @param unknown_type $formato formato da saida
*
* @return string
/**
* moeda
*
* @abstract Classe que formata de desformata valores monetários em float e formata valores
* de float em moeda.
*
* @author anselmo
*
* @email anselmobattisti arroba gmail.com
*
<?php
/**
* Retorna dados sobre o endereço
*
* @url http://code.google.com/apis/maps/documentation/v3/reference.html#GeocoderRequest
*
* @autor Anselmo Battisti ([email protected])
*/
define("URL","http://maps.google.com/maps/api/geocode/json?address=");
class xml2array {
function xml2array($xml) {
if (is_string($xml)) {
$this->dom = new DOMDocument;
$this->dom->loadXml($xml);
}
return FALSE;
}