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
<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);
}
# 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
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');
};
}
@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(){
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>
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
}
@anselmobattisti
anselmobattisti / component.vue
Created February 3, 2018 14:10
To access this inside a nested function create a local variable and store this in this valiable, like the example above
methods: {
save (evt) {
let self = this
evt.preventDefault()
this.$validator.validateAll().then((result) => {
if (result) {
EventBus.$emit('startLoading')
dbUser.save(this.user)
.then((resp) => {
EventBus.$emit('stoptLoading')
const moment = require('moment-timezone')
return moment.utc(date, 'YYYY-MM-DD"T"HH:mm:ss.fffffff"Z"').format('DD/MM/YYYY')
<?
// -------------------
// Lendo arquivo local
// -------------------
$filename = "acervo.csv";
$handle = fopen ($filename, "r");
$conteudo = fread ($handle, filesize ($filename));
/*
// -----------------------------------
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package exercico_ci_1;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.chart.CategoryAxis;