Skip to content

Instantly share code, notes, and snippets.

View tiagocordeiro's full-sized avatar
:octocat:
Focusing

Tiago Cordeiro ⚡ tiagocordeiro

:octocat:
Focusing
View GitHub Profile
text = "Get stylish with DOUBLE BENEFIT at TRENDS! Shop for Rs. 4000 & get benefits worth Rs.4000 on the New season collection from 9th Feb-11th Feb'18 & earn RelianceOne pts. RUSH to ur nearest TRENDS store now! Offer valid in select cities only. T&C More at http://bit.ly/DoubleBenefit "
sentences = text.split('!')
words = text.split()
# print("Palavras: ", words)
# print("Sentences: ", sentences)
@tiagocordeiro
tiagocordeiro / index.html
Last active April 25, 2022 08:14
Responsive Topnav Example (Only CSS)
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
<style>
</style>
</head>
<body>

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@tiagocordeiro
tiagocordeiro / pycharm-regex-django-static.md
Last active December 8, 2021 13:57
Pycharm Regex Find and Replace Static Files

Find what: (href|src)="([a-zA-Z0-9/.-]+[^.html])"

Replace with: $1=\"{% static "assets/$2" %}"

import datetime
def time_in_range(start, end, x):
"""Return true if x is in the range [start, end]"""
if start <= end:
return start <= x <= end
else:
return start <= x or x <= end
import xmltodict
import csv
with open('nfe_entrada_mock.xml') as fd:
nfe = xmltodict.parse(fd.read())
nfe_id = nfe['nfeProc']['NFe']['infNFe']['@Id'] # infNFe Id
itens = nfe['nfeProc']['NFe']['infNFe']['det']
@tiagocordeiro
tiagocordeiro / TelefoneComMascara.html
Created January 12, 2018 14:43
Mascara para telefones no formato brasileiro (com 8 ou 9 dígitos)
<script>
function mascaraTelefone( campo ) {
function trata( valor, isOnBlur ) {
valor = valor.replace(/\D/g,"");
valor = valor.replace(/^(\d{2})(\d)/g,"($1)$2");
if( isOnBlur ) {
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class reports extends MY_Controller
{
function __construct()
{
parent::__construct();
$access = FALSE;
$this->view_data['update'] = FALSE;
@tiagocordeiro
tiagocordeiro / README.md
Last active May 13, 2020 14:57
Script para alimentar uma planilha google através dos forms do Gravity Forms
@tiagocordeiro
tiagocordeiro / anagrama.py
Created May 31, 2017 14:43
Pypratico Exercício Anagrama
def eh_anagrama(str1, str2):
str1 = str1.lower().replace(" ", "")
str2 = str2.lower().replace(" ", "")
anagrama = sorted(str1) == sorted(str2)
return anagrama
if __name__ == '__main__':
print(eh_anagrama('ABA', 'AaB'))
print(eh_anagrama('THE ALIAS MEN', 'ALAN SMITHEE'))