Skip to content

Instantly share code, notes, and snippets.

View vinirodr's full-sized avatar

Vinicius Rodrigues vinirodr

View GitHub Profile
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266HTTPClient.h>
const char* ssid = "vinirodr";
const char* password = "qwertyui";
IPAddress server(162,243,2,159);
const int httpPort = 80;
// Include Light Sensor library
#include "light.h"
int sensorPin;
void setup() {
// Set sensor pin
sensorPin = 0;
}
//this outputs pot value to screen in ohms
int gasSensor = 0; // select input pin for gasSensor
int val = 0; // variable to store the value coming from the sensor
void setup() {
Serial.begin(9600);
}
void loop() {
@vinirodr
vinirodr / pomodoro.cpp
Last active April 24, 2016 22:06
Assignment pcomp
// Include header file
#include "pomodoro.h"
#include "Arduino.h"
Pomodoro::Pomodoro(int level) {
if (level == 0) {
for (int i = 2; i < 7; i++) {
// digitalWrite(i, LOW);
}
#!/bin/sh
echo -n "Forneça o nome do arquivo a ser verificado: "
read arq
positive_answer(){
echo "\033[33;32mSim\033[0m"
}
negative_answer(){
Pry.config.editor = "subl"
Pry.config.prompt = proc do |obj, level, _|
prompt = ""
prompt << "#{Rails.version}@" if defined?(Rails)
prompt << "#{RUBY_VERSION}"
"#{prompt} (#{obj})> "
end
Pry.config.exception_handler = proc do |output, exception, _|
export PS1='`[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "\[\e[31m\]" || echo "\[\e[32m\]"`$(__git_ps1 "(%s)\[\e[00m\]")\[\e[01;34m\]\w\[\e[00m\] \$ '
@vinirodr
vinirodr / argumentos_nomeados.rb
Created March 1, 2013 18:11
some ruby 2.0 features
# ruby 1.9 - Argumentos Ordenados
def params_1_9(name, age)
name = args[:name]
age = args[:age]
puts name
puts age
end
# ruby 2.0 - Argumentos Nomeados
# Apt
alias apti='sudo apt-get install'
alias apts='sudo apt-cache search'
alias aptp='sudo apt-get --purge remove'
alias aptr='sudo apt-get remove'
# Rails
alias rdbd='rake db:drop'
alias rdbc='rake db:create'
alias rdbm='rake db:migrate'