Skip to content

Instantly share code, notes, and snippets.

View matheusnascgomes's full-sized avatar

Matheus Gomes matheusnascgomes

View GitHub Profile
@matheusnascgomes
matheusnascgomes / Content.js
Last active March 19, 2018 23:15
Dynamic list with react
import React from 'react';
import { Row, Col } from 'react-bootstrap';
import FontAwesome from 'react-fontawesome';
import CategoryTag from './helpers/CategoryTag';
import User from './res/user.jpg';
import './styles/content.css'
export default props => {
@matheusnascgomes
matheusnascgomes / App.js
Created March 20, 2018 03:46
Main Component
import React, { Component } from 'react';
import { Grid, Row, Col } from 'react-bootstrap';
import axios from 'axios';
import Header from './Header';
import Content from './Content';
import LoadMore from './LoadMore';
import Footer from './Footer';
import './styles/app.css';
<?php
function base64_to_png ($img, $im_name) {
if ( ($fp = fopen($im_name . '.png', 'wb')) === false ) {
return false;
}
$img = str_replace('data:image/png;base64,', '', $img);
$img = str_replace(' ', '+', $img);
if ( fwrite($fp, base64_decode($img)) === false ) {
return false;
}
@matheusnascgomes
matheusnascgomes / .eslintrc.json
Last active June 30, 2018 11:30
Configuração padrão do Eslint
{
"extends": "airbnb",
"env": {
"browser": true,
"jest": true
},
"plugins": ["react", "jsx-a11y", "import"],
"rules": {
"react/jsx-one-expression-per-line": "off",
"react/jsx-filename-extension": [
@matheusnascgomes
matheusnascgomes / global.js
Created June 26, 2018 00:38
Configuração padrão global da lib styled-components para ambientes ReactJS e React Native
import { injectGlobal } from 'styled-components';
injectGlobal`
*{
margin: 0;
padding: 0;
box-sizing: border-box;
outline: 0;
}
@matheusnascgomes
matheusnascgomes / reactotron.js
Created July 1, 2018 01:00
Configuração padrão do reactotron para projetos React / ReactJS
import Reactotron from 'reactotron-react-js';
import { reactotronRedux } from 'reactotron-redux';
import sagaPlugin from 'reactotron-redux-saga';
if (process.env.NODE_ENV === 'development') {
const tron = Reactotron.configure()
.use(reactotronRedux())
.use(sagaPlugin())
.connect();
@matheusnascgomes
matheusnascgomes / example
Created July 10, 2018 02:53
How to create VSCode snippets on Linux
/usr/share/code/resources/app/extensions
@matheusnascgomes
matheusnascgomes / App.js
Created July 21, 2018 20:49
Como importar as dependências do AdminLTE de forma correta em um ambiente ReacJS com create-react-app
import React, { Component } from "react";
import "./template/dependencies";
class App extends Component {
render() {
return (
<body className="hold-transition login-page">
<div className="login-box">
<div className="login-logo">
<a href="../../index2.html">
@matheusnascgomes
matheusnascgomes / .gitconfig
Created August 2, 2018 19:57
My git config
[user]
name = Matheus Gomes
email = matheusnascgomes@gmail.com
[alias]
st = status
com = commit -m
br = branch
rup = push origin
rdown = pull origin
logone = log --oneline
user root;
worker_processes 1;
# daemon off;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}