Skip to content

Instantly share code, notes, and snippets.

View luizpicolo's full-sized avatar
👨‍🏫
Teaching

Luiz F. Picolo luizpicolo

👨‍🏫
Teaching
View GitHub Profile
#include <SerialDisplay.h>
#include <ArduinoJson.h>
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
char ssid[] = "NOME_DA_REDE"; // sua rede wifi
char password[] = "SENHA_DA_REDE"; // sua senha
char channelId[] = "ID_DO_CANAL"; // ID do seu canal
char apiKey[] = "CHAVE_DA_API"; // chave da API
SerialDisplay displays(14, 12, 10); // (data D5, clock D6, qtde de modulos)
WiFiClientSecure client;
@taq
taq / gist:1ef38725c39c041f59701f29a83c7fa3
Created October 11, 2016 22:28
Git alias to create a new remote branch based on the current branch
Just insert on .gitconfig:
nrb = "!f() { git push -u origin $(git rev-parse --abbrev-ref HEAD):$1; }; f"
And then, when on a local branch and want to push to a new remote branch called, say, 'test':
$ git nbr test
Total 0 (delta 0), reused 0 (delta 0)
To <your remote here>
* [new branch] work -> test
@matiaskorhonen
matiaskorhonen / sign-pdf.rb
Last active May 25, 2023 10:58
Quick and dirty PDF signing in Ruby (using Origami)
#!/usr/bin/env ruby
require "openssl"
require "time"
begin
require "origami"
rescue LoadError
abort "origami not installed: gem install origami"
end
@cauerego
cauerego / IndexedDB101.js
Last active January 13, 2023 22:00 — forked from JamesMessinger/IndexedDB101.js
Very Simple IndexedDB Example
// quite untested, adapted from BigstickCarpet's gist, attempt to make it simpler to use
function openIndexedDB (fileindex) {
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
var openDB = indexedDB.open("MyDatabase", 1);
openDB.onupgradeneeded = function() {
var db = {}
@ericoporto
ericoporto / ywcc_ptbr.py
Created July 28, 2015 00:39
Yahoo Weather API Condition Codes in Brazilian Portuguese (Códigos do Yahoo Weather em Português - Brasil)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Erico Vieira Porto
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@luizpicolo
luizpicolo / install_server.sh
Last active April 8, 2017 22:26
Install Server
# Configure Timezone
dpkg-reconfigure tzdata
# Configure locale
locale-gen pt_BR pt_BR.UTF-8
locale-gen en_US en_US.UTF-8
# Instalar Postgree e trocar senha
sudo apt-get install postgresql postgresql-contrib
psql -c "ALTER USER postgres WITH PASSWORD 'nova_senha'" -d template1
@joshteng
joshteng / dokku_setup.md
Last active May 12, 2022 14:38
Using Dokku to deploy a Rails Application

#Goal Deploy your Rails App super easily with Dokku on Digital Ocean cheap cheap!

##Notes

  • Follow 12 factor design (include the rails_12factor gem)
  • Don't forget your Procfile with the command to start up your application server
  • I prefer using external hosted logging services like Logentries (not in this guide)
  • Set up performance monitoring AppSignal or New Relic (not in this guide)
@luizpicolo
luizpicolo / install.sh
Last active September 7, 2016 15:02
Auto Installer
#!/bin/bash
# install zsh
rm -fr .oh-my-zsh/
curl -L http://install.ohmyz.sh > install.sh
sh install.sh
# add final .zshrc
echo 'source ~/.bash_aliases' >> ~/.zshrc
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> >> ~/.zshrc
@emad-elsaid
emad-elsaid / gravatar.rb
Created March 7, 2014 13:07
Gravatar image url generator simple method Gravatar image url generator simple method
#!/usr/bin/env ruby
require 'digest/md5'
require "addressable/uri"
# this is based on gravatar image API
# https://en.gravatar.com/site/implement/images/
# options :
# size : <integer> size of image
# default: <string> url of image if email not found or:
# * 404