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
@Senhordim
Senhordim / .eslintrc.json
Created February 4, 2019 19:19
Eslint for React Native
{
"parser": "babel-eslint",
"extends": ["airbnb", "plugin:react-native/all"],
"plugins": ["react-native", "jsx-a11y", "import"],
"env": {
"jest": true
},
"rules": {
"react-jsx-filename-extension": [
"error",
@Senhordim
Senhordim / index.html
Created January 6, 2018 19:26
Hello word with React
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Hello Word with React!</title>
</head>
<body>
<div id="app"></div>
@PutMapping(value="/{id}")
public Product updateProductWithId(@PathVariable Long id, Product product) {
Product currentProduct = productDAO.findOne(id);
currentProduct.setCode(product.getCode());
currentProduct.setDescription(product.getDescription());
currentProduct.setUnitPrice(product.getUnitPrice());
return productDAO.save(product);
}
@Senhordim
Senhordim / App.js
Created September 27, 2017 22:18
Firebase exemplos
import React, { Component } from 'react';
import { View, Text, Button } from 'react-native';
import firebase from 'firebase';
export default class App extends Component {
constructor(props){
super(props);
this.state = { pontuacao: '' }
}
@Senhordim
Senhordim / ListItems.js
Created September 16, 2017 16:48
get endpoint with axios
import React, { Component } from 'react';
import {
ScrollView
} from 'react-native';
import axios from 'axios';
import Items from './Items';
export default class ListItems extends Component {
constructor(props) {
@Senhordim
Senhordim / reactNativeAbout.js
Last active December 14, 2019 22:59
Ciclo de vida de construção de um componente do React Native
// Clico de vida de um componente
// 1
constructor(props) {
super(props);
console.log('contruindo a aplicação');
}
//2
componentWillMount() {
ERROR watchman --no-pretty get-sockname returned with exit code=null, signal=SIGABRT, stderr= 2017-08-18T12:22:25,828: [cli] Failed to open /Users/srdim/Library/LaunchAgents/com.github.facebook.watchman.plist for write: Not a directory
Error: watchman --no-pretty get-sockname returned with exit code=null, signal=SIGABRT, stderr= 2017-08-18T12:22:25,828: [cli] Failed to open /Users/srdim/Library/LaunchAgents/com.github.facebook.watchman.plist for write: Not a directory
at ChildProcess.<anonymous> (/Users/srdim/mobile_apps/bobapp/node_modules/metro-bundler/node_modules/sane/node_modules/fb-watchman/index.js:198:18)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:891:16)
at Socket.<anonymous> (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
@Senhordim
Senhordim / express-server-side-rendering.md
Created July 11, 2017 02:08 — forked from joepie91/express-server-side-rendering.md
Rendering pages server-side with Express (and Pug)

Terminology

  • View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
  • View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
  • HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
  • String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
def params_vehicle
params.require(:vehicle).permit(
:name,
:vehicle_type,
:national,
:country,
:state,
:url,
:address,
publication_day: []