This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import smtplib, ssl | |
| from email.mime.text import MIMEText | |
| from email.mime.multipart import MIMEMultipart | |
| sender_email = "my@gmail.com" | |
| receiver_email = "your@gmail.com" | |
| password = "your_password" | |
| message = MIMEMultipart("alternative") | |
| message["Subject"] = "multipart test" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ruby:2.5.1 | |
| RUN groupadd --gid 1000 node \ | |
| && useradd --uid 1000 --gid node --shell /bin/bash --create-home node | |
| # gpg keys listed at https://github.com/nodejs/node#release-team | |
| RUN set -ex \ | |
| && for key in \ | |
| 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \ | |
| FD3A5288F042B6850C66B31F09FE44734EB7990E \ | |
| 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const RADIUS_EARTH = 6378000; | |
| const randomInsideCircle = (center, radius) => { | |
| const { lat, lng } = center; | |
| const [ a, b ] = [ Math.random(), Math.random() ].sort(); | |
| const dx = b * radius * Math.cos((2 * Math.PI * a) / b); | |
| const dy = b * radius * Math.sin((2 * Math.PI * a) / b); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Statement | |
| Given an expression string exp, write a program to examine whether | |
| the pairs and the orders of {,},(,),[,] are correct in exp. | |
| For example: | |
| The program should print True for exp = “[()]{}{[()()]()}” and False for exp = “[(])” | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Triangulo: | |
| def __init__(self, a, b, c): | |
| self.a = a | |
| self.b = b | |
| self.c = c | |
| def gerar_lados_ordenados(self): | |
| return sorted([self.a, self.b, self.c]) | |
| def semelhantes(self, triangulo): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find . -type f | xargs grep -H -c 'id:' | grep 0$ | cut -d':' -f1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function (doc) { | |
| function getForm() { | |
| return doc.querySelector('#formQuestao'); | |
| } | |
| function getQuestionId() { | |
| const form = getForm(); | |
| return parseInt(form.querySelector('input[name="questao_id"]').value, 10); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # rodrigo.deodoro@esharesinc.com | |
| def validate_matrix(matrix): | |
| # Valida linhas | |
| if not all(list_int(i) for i in matrix): | |
| return False | |
| # Valida colunas | |
| columns = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from collections import Counter, defaultdict | |
| class TextSearch: | |
| def __init__(self, url): | |
| self.url = url | |
| self.word_list = [str(v).lower() for v in self.get_text().split()] | |
| self.word_lenght = len(self.word_list) | |
| self.word_count = Counter(self.word_list) | |
| self.count_word = defaultdict(list) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:window.open('data:text/plain;base64,'+btoa(angular.element(document.querySelector('.md-tab-content:not(.ng-hide) .charge')).scope().$parent.$parent.charges.map(c => `${c.post_date.split('-').reverse().join('/')};${c.title};${c.category};${(c.amount/100).toFixed(2).replace('.', ',')}`).join('\n'))) |