Skip to content

Instantly share code, notes, and snippets.

@paulobarcelos
paulobarcelos / AWS_Single_LetsEncrypt.yaml
Last active October 6, 2019 11:43 — forked from garipov/AWS_Single_LetsEncrypt.yaml
AWS Elastic Beanstalk .ebextensions config for single instance free SSL using letsencrypt certbot and nginx. http://bluefletch.com/blog/domain-agnostic-letsencrypt-ssl-config-for-elastic-beanstalk-single-instances/
# Dont forget to set the env variables CERT_EMAIL and CERT_DOMAIN
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
ToPort: 443
FromPort: 443
@paulobarcelos
paulobarcelos / exportParseEmail.js
Last active September 6, 2016 08:52
Exports emails in a Parse collection json.
var args = process.argv.slice(2);
if(args.length != 4){
console.log('Usage example: node exportParseEmail.js _User.json france "06-01-2016" ./')
return;
}
var input = args[0];
var market = args[1];
var createdFrom = args[2];
var outputDir = args[3];
@paulobarcelos
paulobarcelos / pins_arduino.h
Created April 10, 2015 09:03
Quirkbot for Platform io
// #############################################################################
// #############################################################################
// LEONARDO --------------------------------------------------------------------
/*
pins_arduino.h - Pin definition functions for Arduino
Part of Arduino - http://www.arduino.cc/
Copyright (c) 2007 David A. Mellis
This library is free software; you can redistribute it and/or
@paulobarcelos
paulobarcelos / designer.html
Last active August 29, 2015 14:14
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../paper-toggle-button/paper-toggle-button.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
@paulobarcelos
paulobarcelos / gist:5d9d8c2859f85fc5749a
Created November 18, 2014 18:43
eu sou sou hacker
var sync = function(){console.log('sync')}
var leftPage = false
var t = 0;
var c = function(){
if((Date.now()-t) > 500){
leftPage=true
}
else if(leftPage){
leftPage=false; sync()
};
@paulobarcelos
paulobarcelos / makehub
Last active August 29, 2015 14:07 — forked from ahmedabdulaziz/makehub
AIR QUALITY STATION
# Title
AIR QUALITY STATION
# Picture
media: http://s27.postimg.org/n9159lwpf/1604581_626258354094217_2010345751_n.jpg
# Objective
the main Objective of this project is to measure pollution percentage in the air specially carbon monoxide in cities and for industrial applications. we tend to make it like as a distributed stations around the world to make a map for the pollution in the world.
# Duration
3 days
# Age Group
all
@paulobarcelos
paulobarcelos / CSSData.js
Created October 1, 2014 07:11
Creates a bridge between CSS and JS, so you can expose properties to your script.
/**
* CSSData
*
* This class will create a bridge between CSS and JS, what will come in handy
* to for example, expose LESS varibles to your script.
*
* It works by creating an invisible dom element (*)div#cssdata, that will have it's
* (**)style.fontFamily filled via CSS. We then can access that property via
* window.getComputedStyle (use a pollyfill if needed), and parse the result to
* JSON.
@paulobarcelos
paulobarcelos / Drawdio.cpp
Last active August 29, 2015 13:56
Arduino Drawdio
const int in = A0;
const int out = 9;
int freq = 0;
float v = 0;
void setup() {
pinMode(out, OUTPUT);
}