Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Lucas Simon Rodrigues Magalhaes lucassimon

🏠
Working from home
View GitHub Profile
@lucassimon
lucassimon / cloudbuild.log
Created Jul 26, 2020
Erro ao criar .env por causa da permissao como root e também sem a pasta vendor para fazer composer install
View cloudbuild.log
Starting Step #1 - "Rodando docker ps"
Step #1 - "Rodando docker ps": Already have image (with digest): gcr.io/cloud-builders/docker
Step #1 - "Rodando docker ps":
Step #1 - "Rodando docker ps": ***** NOTICE *****
Step #1 - "Rodando docker ps":
Step #1 - "Rodando docker ps": Alternative official `docker` images, including multiple versions across
Step #1 - "Rodando docker ps": multiple platforms, are maintained by the Docker Team. For details, please
Step #1 - "Rodando docker ps": visit https://hub.docker.com/_/docker.
Step #1 - "Rodando docker ps":
Step #1 - "Rodando docker ps": ***** END OF NOTICE *****
View elasticsearch_repo.py
def create_index(es_object, index_name="recipes"):
created = False
# index settings
settings = {
"settings": {"number_of_shards": 1, "number_of_replicas": 0},
"mappings": {
"members": {
"dynamic": "strict",
"properties": {
"title": {"type": "text"},
View baseof.html
<!DOCTYPE html>
<html class="no-js" lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-US{{ end }}">
<head>
{{ "<!-- Basic Page Needs -->" | safeHTML }}
{{ block "schema-dot-org" . }}
<!-- schema.org metadata differs for Nodes and Pages -->
{{ end }}
View decorators.py
import hashlib
import memcache
import traceback
from flask import request
from functools import wraps
from wakatime_website import app
from werkzeug.contrib.cache import MemcachedCache
mc = memcache.Client()
cache = MemcachedCache(mc)
@lucassimon
lucassimon / index.js
Created Jul 23, 2019
Ajuda com testes no react ComponentDidMount, axios e setState
View index.js
import React from 'react';
import { connect } from 'react-redux';
import {
Container, Grid, Menu,
} from 'semantic-ui-react';
import CustomerService from '../../services/CustomerService';
import { customerListStart, customerListSuccess, customerListError } from './actions';
import Create from './Create';
import List from './List';
View CtaImage.js
import React from 'react'
class CtaImage extends React.Component {
constructor(props) {
super(props)
this.state = { image: null }
}
componentDidMount() {
const { ctaImage } = this.props
@lucassimon
lucassimon / 10-keyboard.conf
Last active Dec 29, 2018
How to install arch
View 10-keyboard.conf
Section "InputClass"
Identifier "evdev keyboard catchall"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "XkbLayout" "br"
Option "XkbVariant" "abnt2"
EndSection
View handleSubmit.js
onSubmit={ async (values, actions) => {
let attemps = 1
while ( attemps <= 2) {
try {
await SupplierService.create(values, token)
actions.setSubmitting(false);
// TODO: Fetch the paginated data
handleOpenSnackBar('Registro inserido com sucesso', 'success')
close();
View test_iugu.py
# -*- coding: utf-8 -*-
# Third
import iugu
# Apps
# apps
from apps.zipcodes.postmon import postmon_search_cep
from apps.zipcodes.zip_code import translate_to_iugu
@lucassimon
lucassimon / sms.py
Created May 2, 2017
Envio de sms com zenvia
View sms.py
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
# Stdlib imports
import requests
import base64
# Core Django imports
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.views.generic import (
You can’t perform that action at this time.