Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Pandiyaraja Ramamoorthy pontiyaraja

🎯
Focusing
View GitHub Profile
@pontiyaraja
pontiyaraja / parse_json.go
Created Jul 12, 2019 — forked from mjohnsullivan/parse_json.go
Parse JSON objects with arbitrary key names in Go using interfaces and type assertions
View parse_json.go
// Parsing arbitrary JSON using interfaces in Go
// Demonstrates how to parse JSON with abritrary key names
// See https://blog.golang.org/json-and-go for more info on generic JSON parsing
package main
import (
"encoding/json"
"fmt"
)
@pontiyaraja
pontiyaraja / Pipelined SET.java
Created Sep 30, 2016 — forked from tareqabedrabbo/Pipelined SET.java
Redis Pipelines and Transactions
View Pipelined SET.java
Pipeline pipeline = jedis.pipelined();
long start = System.currentTimeMillis();
for (int i = 0; i < 100000; i++) {
pipeline.set("" + i, "" + i);
}
List<Object> results = pipeline.execute();
long end = System.currentTimeMillis();
System.out.println("Pipelined SET: " + ((end - start)/1000.0) + " seconds");
@pontiyaraja
pontiyaraja / Example log
Created Sep 29, 2016 — forked from dspezia/Example log
Assessing pending activity of a Redis server
View Example log
> ~/tcp_redis_monitor.py 6379
Timestamp Nb TX bytes RX bytes TX RMA RX RMA
1333983822.943 1 0 0 0.000 0.000
1333983823.193 1 0 0 0.000 0.000
1333983824.194 1 0 0 0.000 0.000
1333983825.195 1 0 0 0.000 0.000
1333983826.196 1 0 0 0.000 0.000
@pontiyaraja
pontiyaraja / redis-eventsource.go
Created Sep 27, 2016 — forked from jweir/redis-eventsource.go
Example of using Redis PubSub and EventSource with golang
View redis-eventsource.go
package main
import (
eventsource "github.com/antage/eventsource/http"
redis "github.com/vmihailenco/redis"
"log"
"net/http"
)
func haltOnErr(err error){
@pontiyaraja
pontiyaraja / GoSetup
Created Aug 4, 2016 — forked from rb16/GoLang setup
GOlang Setup Environment Linux and OS X
View GoSetup
#Set these variables in .bash_profile (OS X) file
export GOPATH=$HOME/workspace
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@pontiyaraja
pontiyaraja / restAPI.markdown
Created Jun 16, 2016 — forked from iksose/restAPI.markdown
Creating a REST API using Node.js, Express, and MongoDB
View restAPI.markdown

###Creating a REST API using Node.js, Express, and MongoDB

####Installing Node.js

Go to http://nodejs.org, and click the Install button. Run the installer that you just downloaded. When the installer completes, a message indicates that Node was installed at /usr/local/bin/node and npm was installed at /usr/local/bin/npm. At this point node.js is ready to use. Let’s implement the webserver application from the nodejs.org home page. We will use it as a starting point for our project: a RESTful API to access data (retrieve, create, update, delete) in a wine cellar database.

Create a folder named nodecellar anywhere on your file system. In the wincellar folder, create a file named server.js.

@pontiyaraja
pontiyaraja / install-redis.sh
Created May 11, 2016 — forked from dstroot/install-redis.sh
Install Redis on Amazon EC2 AMI
View install-redis.sh
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
You can’t perform that action at this time.