Skip to content

Instantly share code, notes, and snippets.

View Senhordim's full-sized avatar
🏠
Working from home

Diego Collares Senhordim

🏠
Working from home
View GitHub Profile
"vehicle"=>{"vehicle_type"=>"audio", "name"=>"dsdsdssdd", "national"=>"true", "country"=>"BR", "state"=>"", "url"=>"", "address"=>"", "publication_day"=>["", "seg", "ter"]}
const webpack = require('webpack');
module.exports = {
entry: {
filename: './app.js'
},
output: {
;(function(document){
"use strict";
var zipCode = document.querySelector('#user_profile_attributes_stores_attributes_0_address_attributes_zipCode');
var street = document.querySelector('#user_profile_attributes_stores_attributes_0_address_attributes_street');
var complement = document.querySelector('#user_profile_attributes_stores_attributes_0_address_attributes_complement');
var neighborhood = document.querySelector('#user_profile_attributes_stores_attributes_0_address_attributes_neighborhood');
var city = document.querySelector('#user_profile_attributes_stores_attributes_0_address_attributes_city');
var state = document.querySelector('#user_profile_attributes_stores_attributes_0_address_attributes_state');
// Index.ios.js - place code in here for IOS!!!
// Import a library to help create a component
import React, { Component } from 'react';
import { AppRegistry} from 'react-native';
import Hader from './src/components/header'
// Create a component
const App = () => (
rake aborted!
remote: ExecJS::ProgramError: SyntaxError: Unexpected token: name (theme) (line: 14697, col: 32, pos: 407583)
remote: Error
remote: at new JS_Parse_Error (<eval>:3623:11948)
remote: at js_error (<eval>:3623:12167)
remote: at croak (<eval>:3623:22038)
remote: at token_error (<eval>:3623:22175)
remote: at unexpected (<eval>:3623:22263)
remote: at semicolon (<eval>:3623:22781)
remote: at simple_statement (<eval>:3623:25959)
@Senhordim
Senhordim / intro_sql_with_postgres.sql
Last active October 22, 2016 01:16
Essencial SQL com Postgres
/*
TIPO DE DAOS MAIS COMUNS
INTEGER (número inteiro não tem casa decimais)
NUMERIC (númeoro com casas decimais )
CHAR(N) (string simples com tamanho definido)
VARCHAR(N) (string com tamanho varivável)
BOOLEAN (True ou False )
TIMESTAMP ( Date e hora)
SERIAL (AUTO-INCREMENTO NO POSTGRES)
@Senhordim
Senhordim / mask.js
Created August 24, 2016 19:11
Solução Mask input para Telefone com 8 e 9 dígitos
// jQuery Masked Input
$('#celular').mask("(99) 9999-9999?9").ready(function(event) {
var target, phone, element;
target = (event.currentTarget) ? event.currentTarget : event.srcElement;
phone = target.value.replace(/\D/g, '');
element = $(target);
element.unmask();
if(phone.length > 10) {
element.mask("(99) 99999-999?9");
} else {
@Senhordim
Senhordim / friendly_urls.markdown
Created August 19, 2016 22:29 — forked from cdmwebs/friendly_urls.markdown
Friendly URLs in Rails

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:

/people/6

But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.

@Senhordim
Senhordim / politica_de_privacidade.html
Created May 3, 2016 14:19
Política de privacidade e Termos de Uso
<p>Todas as suas informações pessoais recolhidas serão usadas para o ajudar a tornar a sua visita ao nosso site o mais produtiva e agradável possível.</p>
<p>A garantia da confidencialidade dos dados pessoais dos utilizadores do nosso site é importante para o Viva a Segunda.</p>
<p>Todas as informações pessoais relativas a membros, assinantes, clientes ou visitantes que utilizem o Viva a Segunda serão tratadas em concordância com a Lei da Proteção de Dados Pessoais de 26 de outubro de 1998 (Lei n.° 67/98).</p>
<p>A informação pessoal recolhida pode incluir seu nome, e-mail, número de telefone e/ou telefone celular, endereço, data de nascimento e/ou outros.</p>
<p>O uso do Viva a Segunda pressupõe a aceitação deste acordo de privacidade. A equipe do Viva a Segunda reserva-se ao direito de alterar este acordo sem aviso prévio. Deste modo, recomendamos que consulte esta página com regularidade de forma a estar sempre atualizado.</p>
<h3>Os anúncios</h3>
<p>Tal com
getList(successCallback){
let storage = new Storage(SqlStorage);
storage.query("SELECT * FROM accounts").then((data) => {
let list = [];
for (var i = 0; i < data.res.rows.length; i++) {
let item {};
item.id = data.res.rows.item(i).id;