Skip to content

Instantly share code, notes, and snippets.

View felipeandres254's full-sized avatar
🇨🇴
🤓

Andrés Felipe Torres felipeandres254

🇨🇴
🤓
View GitHub Profile
(() => {
var plate = ''
while (!plate) plate = prompt('Insert your plate number:');
console.clear()
document.body.innerHTML = '<svg viewBox="0 0 600 600"></svg>'
Object.assign(document.body.style, {
width: '100vw', height: '100vh', margin: 0, padding: 0, background: '#000000',
position: 'fixed', top: 0, right: 0, bottom: 0, left: 0, overflow: 'hidden',
})
@felipeandres254
felipeandres254 / aws_certificate_validation.gs
Last active March 10, 2019 15:44
Google Apps Script web endpoint to auto-validate AWS Certificates
function doPost(event) {
// Check script token
var token = PropertiesService.getScriptProperties().getProperties().token || '';
if (!event.parameter.token || event.parameter.token != token) {
return ContentService.createTextOutput(JSON.stringify({ success: false, message: 'Invalid token' }))
.setMimeType(ContentService.MimeType.JSON);
}
// Check domain parameter
if (!event.parameter.domain) {
@felipeandres254
felipeandres254 / mbox.py
Created July 1, 2017 02:59
Split a Gmail MBOX file into individual mail files
#!/usr/bin/env python3
import os, re, sys, time, datetime
from dateutil.parser import parse
from dateutil.tz import tzutc
def seg2hms( value ):
return str(datetime.timedelta(seconds=value))
def datasize( value ):
idx, prefix = 0, ["", "K", "M", "G", "T"]
@felipeandres254
felipeandres254 / requirements.txt
Last active July 1, 2017 11:40
Company info download from Colombian NIT. In collaboration with @cecabrera
requests==2.2.1
beautifulsoup4==4.6.0
@felipeandres254
felipeandres254 / email.html
Last active February 16, 2018 18:27
Template for responsive email
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<style type="text/css">
body { min-width:calc(100% - 30px); Margin:0; padding:15px; background-color:#eeeeee; }
table { font-family:sans-serif; color:#222222; border-spacing:0; } td { padding:0; } img { border:0; }
@felipeandres254
felipeandres254 / expa_auth.py
Last active April 16, 2018 19:16
Python 2.7 code snippet to get AIESEC EXPA Token
#!/usr/bin/env python
import re, requests
def GET_TOKEN( email=None, password=None ):
if email and password:
AUTH = {
"user[email]":email,
"user[password]":password
}
r = requests.post("https://auth.aiesec.org/users/sign_in", data=AUTH, verify=False)