Skip to content

Instantly share code, notes, and snippets.

View thulioph's full-sized avatar
🔥

Thulio Philipe thulioph

🔥
View GitHub Profile
@thulioph
thulioph / Emmet.sublime-settings
Last active June 17, 2023 02:19
Alterando o "lang" do ST2 para pt-BR ou qualquer outra que preferir.
// Você abre o ST2 e quando gera o html:5 ele retorna a lang diferente do pt-BR (padrão brasileiro); Vá em:
// Preferences > Package Settings > Emmet > Settings - User
{
"snippets": {
"variables":{
"lang": "pt-BR",
"locale": "pt-BR"
}
}
@thulioph
thulioph / load-nvmrc.sh
Created November 5, 2021 14:35
Script to call nvm use automatically in a directory with a .nvmrc file
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$node_version" ]; then
@thulioph
thulioph / mapa.js
Created December 27, 2013 22:32
código final e completo do mapa personalizado / Artigo: API Google Maps V3 - blog.thulioph.com
function initialize() {
// Exibir mapa;
var myLatlng = new google.maps.LatLng(-8.0631495, -34.87131120000004);
var mapOptions = {
zoom: 17,
center: myLatlng,
panControl: false,
// mapTypeId: google.maps.MapTypeId.ROADMAP
mapTypeControlOptions: {
@thulioph
thulioph / service-worker.js
Created March 16, 2017 06:31
service worker example
(function() {
'use strict';
var cacheName = 'cache_v2.0';
var cacheFiles = [
'./',
'./index.html',
'./sw.js',
'./manifest.json',
'./src/assets/js/libs/sweetalert.min.js',
@thulioph
thulioph / security-of-web-applications.md
Last active October 27, 2020 13:33
post sobre segurança no desenvolvimento de aplicações web

Segurança no Desenvolvimento de Aplicações Web

Questões de segurança acontecem principalmente porque:

Desenvolvedores que sabem das coisas, mas esquecem ou ignoram.

Devido ao crescimento da web e da necessidade cada vez maior de aplicações web utilizarem o compartilhamento de informações, faz se necessária a adoção de mecanismos para manter tais aplicações e informações seguras. O artigo mostra as principais vulnerabilidades encontradas em aplicações web, e como você pode conhece-las melhor.

Vulnerabilidades

@thulioph
thulioph / passo-03-api-google-maps.js
Last active August 1, 2020 15:39
personalizando e animando o marcador no mapa / Artigo: API Google Maps V3 - blog.thulioph.com
function initialize() {
// Exibir mapa;
var myLatlng = new google.maps.LatLng(-8.0631495, -34.87131120000004);
var mapOptions = {
zoom: 17,
center: myLatlng,
panControl: false,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
@thulioph
thulioph / Preferences.sublime-settings
Created September 4, 2013 01:09
settings-user para o sublime text 2
{
"color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme", // esquema de cores padrão do sublime
"theme": "Nexus.sublime-theme", // Tema utilizado
"caret_style": "phase", // Alterando o estilo do cursor (“smooth”, “phase”, “blink”, “wide”, “solid”)
"font_size": 8, // tamanho da fonte
"highlight_line": true, // Highlight na linha que o cursor se encontra
"line_padding_bottom": 1, // adicionando um padding bottom na linha para melhorar a legibilidade
"line_padding_top": 1, // adicionando um padding top na linha para melhorar a legibilidade
"fade_fold_buttons": false, // deixar sempre visível a opção de show/hide code folding
"bold_folder_labels": true, // deixa as pastas do projeto em negrito na barra lateral, diferenciando as pasta dos arquivos
@thulioph
thulioph / PrivateRoute.jsx
Last active March 13, 2019 23:18
Example of a HOC to manage route permissions in React.
import React from 'react';
import { withRouter, Redirect } from 'react-router-dom';
const PrivateRoute = (WrappedComponent) => {
class PrivateRoute extends React.Component {
state = {
isLogged: false,
}
_checkAuthentication() {
import gql from 'graphql-tag';
const USER_FRAGMENT = {
account: gql`
fragment AccountDetails on FinancialUserType {
id
username
email
firstName
lastName
@thulioph
thulioph / zombies.json
Created November 18, 2018 03:40
Zombies data to test my case of use
[
{
"title": "Classic zombies",
"picture": "https://via.placeholder.com/150x80/000000/FFFFFF/?text=Imagem+01",
"description":
"Slow, quiet and clumsy, the reason for these dead to reanimate is unknown. After a zombie apocalypse, all dead humans turn into zombies. Being bitten by a zombie results in illness and death. Can only be killed by massive brain trauma."
},
{
"title": "Voodoo Zombies",
"picture": "https://via.placeholder.com/150x80/000000/FFFFFF/?text=Imagem+02",