Skip to content

Instantly share code, notes, and snippets.

@jreisstudio
jreisstudio / gist:7265314
Created November 1, 2013 13:19
trick to customize the select box. 1 - create a styled-select 2 - put out the select things
.styled-select {
margin: 0px 5px 0 0;
-webkit-border-radius: 4px;
background: white url("dropdown_arrow.png") no-repeat right;
border: 1px solid #c6c6c6;
border-radius: 4px;
overflow: hidden;
width: 230px;
}
@jreisstudio
jreisstudio / Foreman.readme
Created August 21, 2013 19:37
Foreman - utilização
---: gem install foreman
---: gem install subcontractor (para usar projetos que dependem de gemsets diferentes!)
---: Criar o Procfile assim:
app1: subcontract --rvm <<versao ruby>>@<<app1> --chdir ./<<diretorio app1>> --signal INT -- bundle exec rails s
app2: subcontract --rvm <<versao ruby>>@<<app2> --chdir ./<<diretorio app2>> --signal INT -- bundle exec rackup
.
.
.
@jreisstudio
jreisstudio / molotov.vim
Created July 12, 2013 13:39
melhor opção de template pro vim!
" ___ __
" /'\_/`\ /\_ \ /\ \__
" /\ \ ___\//\ \ ___\ \ ,_\ ___ __ __
" \ \ \__\ \ / __`\\ \ \ / __`\ \ \/ / __`\/\ \/\ \
" \ \ \_/\ \/\ \L\ \\_\ \_/\ \L\ \ \ \_/\ \L\ \ \ \_/ |
" \ \_\\ \_\ \____//\____\ \____/\ \__\ \____/\ \___/
" \/_/ \/_/\/___/ \/____/\/___/ \/__/\/___/ \/__/
"
" Burn, baby, burn! {{{
"
@jreisstudio
jreisstudio / .vimrc
Last active December 19, 2015 07:49
.vimrc
"Configurações do tab para que ele seja substituido por 2 espaços.
set expandtab
set shiftwidth=2
set softtabstop=2
set tabstop=2
"Configurações de exibição de número de linhas.
set ruler
set number
set numberwidth=3
set cpoptions+=n
@jreisstudio
jreisstudio / AnObserverTest.rb
Last active December 11, 2015 05:58
A Ruby observer implementation...the idea is to use that in my Arduino Tank Monitor!
require "./Subscriber"
require "./InheritanceSub"
require "./InheritanceSubB"
require"./ObserverRuby"
observer = ObserverRuby.new
sub1 = Subscriber.new
sub2 = Subscriber.new
sub3 = InheritanceSub.new
sub4 = InheritanceSubB.new
@jreisstudio
jreisstudio / sendMail.ino
Last active December 11, 2015 01:18
LDR sensor + Arduino + Ruby....The idea is to send an email when the light downs!
#define LDR 0
void setup() {
Serial.begin(9600);
}
void loop() {
int LDR_value = analogRead(LDR);
Serial.println(LDR_value);
delay(250);
}
require "serialport"
@serial_port = SerialPort.new "/dev/tty.usbmodem1421"
def onOff()
21puts "Type something..: (on/ off / bye )"
command = gets.chomp
if command=="on"
puts "The LED is on..."
sleep 1
@jreisstudio
jreisstudio / PythonArduino.py
Created January 11, 2013 01:28
Python + Arduino on/off the LED.
import serial # you need to install the pySerial :pyserial.sourceforge.net
import time
# your Serial port should be different!
arduino = serial.Serial('/dev/tty.usbmodem1411', 9600)
def onOffFunction():
command = raw_input("Type something..: (on/ off / bye )");
if command =="on":
print "The LED is on..."
time.sleep(1)
@jreisstudio
jreisstudio / Observer.py
Last active December 10, 2015 01:38
Python Observer
from Subscriber import *
class Observer:
subscribersList = []
def subscribe(self,subscriber):
try:
if self.isAllowedSubscriber(subscriber):
if self.uniqueIdValidation(subscriber.id):
self.subscribersList.append(subscriber)
@jreisstudio
jreisstudio / simpleObserver.js
Created December 11, 2012 18:22
Simple Observer
function SimpleObserver(){
var subscribersList=[];
this.subscribe = function (_objectSub, _methodSub,_id){
var subscriber = {}
subscriber.subObject=_objectSub;
subscriber.subMethod=_methodSub;
subscriber.subId = _id;
subscribersList.push(subscriber);
}