Skip to content

Instantly share code, notes, and snippets.

@nishantmodak
nishantmodak / spree-gemfile
Created March 24, 2014 05:08
spree-gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.3'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
package main
import (
"net/http"
)
func main() {
fs := http.FileServer(http.Dir("public"))
http.ListenAndServe(":8080", fs)
}
package main
import (
"fmt"
"net/http"
"time"
)
func main() {
http.HandleFunc("/", handler)
package main
import (
"fmt"
"net/http"
"time"
)
func main() {
http.HandleFunc("/", root)
  • Xively
  • Carriots
  • 1248
  • Opensense
  • opensensors.io
  • Eyehub
  • Thingspeak
  • Yanza
@nishantmodak
nishantmodak / nginx.conf
Created April 2, 2015 18:08
nginx.conf
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
@nishantmodak
nishantmodak / example.com.conf
Last active August 29, 2015 14:18
sites-enabled/example.com
server {
listen 80;
server_name www.example.com example.com;
access_log /var/log/Nginx/example_com_access.log;
error_log /var/log/Nginx/example_com_error.log;
location / {
root /var/www/www.example.com;
index index.html index.htm;
}
@nishantmodak
nishantmodak / tic_tac_toe_arduino_ir.ino
Last active December 17, 2015 05:49
TV Remote (Sony) Controlled Arduino Uno , Tic Tac Toe
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
int i = 0;
int blinkarray[11];
int user=0;
void setup()
{
for(i=2;i<11;i++)
@nishantmodak
nishantmodak / blink.ino
Created June 20, 2013 11:14
Blink LED on 13
@nishantmodak
nishantmodak / serialport.rb
Created June 20, 2013 11:17
Serial Port Ruby
require "serialport"
#params for serial port
port_str = "/dev/ttyUSB0" #may be different for you
baud_rate = 9600
data_bits = 8
stop_bits = 1
parity = SerialPort::NONE