Skip to content

Instantly share code, notes, and snippets.

View ravindranathakila's full-sized avatar

Ravindranath Akila ravindranathakila

View GitHub Profile
@ravindranathakila
ravindranathakila / HighchartsConfig.json
Last active August 29, 2015 14:03
Highcharts Config
{
"colors": ["#7cb5ec", "#434348", "#90ed7d", "#f7a35c",
"#8085e9", "#f15c80", "#e4d354", "#8085e8", "#8d4653", "#91e8e1"],
"symbols": ["circle", "diamond", "square", "triangle", "triangle-down"],
"lang": {
"loading": "Loading...",
"months": ["January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December"],
"shortMonths": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
"weekdays": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
/**
* Prepare the App Folder
*/
(function(){
window.appRootDirName = ".myapp";
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log("device is ready");
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
package com.vast.example
import java.net.InetSocketAddress
import java.util.UUID
import java.util.concurrent.{Executors, TimeUnit}
import com.google.common.base.Splitter
import com.twitter.finagle.http.Http
import com.twitter.finagle.builder.{Server, ServerBuilder}
import com.twitter.finagle.service.TimeoutFilter
import com.twitter.finagle.{Service, SimpleFilter, GlobalRequestTimeoutException}
var crypto = require('crypto');
/**
* Calculates the hash/checksum of a string. Default algorithm is MD5.
*
* @param {String} str
* @param {String} algorithm
* @return {String} checksum
* @api public
*/
// create a new store
var store = new Lawnchair({adaptor:'dom', table:'people'});
// saving documents
store.save({name:'brian'});
// optionally pass a key
store.save({key:'config', settings:{color:'blue'}});
// updating a document in place is the same syntax
/*
* Adds the serialNumber property to the UIDevice class
*
* The implementation uses undocumented (for iOS) IOKit functions,
* so handle with caution and be prepared for nil.
*/
#import <UIKit/UIDevice.h>
@interface UIDevice (serialNumber)
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.charset.Charset;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;
import org.jboss.netty.bootstrap.ClientBootstrap;
import org.jboss.netty.bootstrap.ServerBootstrap;

Introduction to Kafka

Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.

Terminology:

  • Producers send messages to brokers
  • Consumers read messages from brokers
  • Messages are sent to a topic
@ravindranathakila
ravindranathakila / setup_ejabberd_macos
Last active January 6, 2017 03:47
Setup ejabberd on Mac OS
http://www.process-one.net/docs/ejabberd/guide_en.pdf
! Note that logs go in /usr/local/var/log/ejabberd/ (if you cant find logs here either, just run ./ejabberdct without any arguments and the default log location will be shown as examples)
To create an admin user, go to sbin:
./ejabberdctl register admin www.yourdomain.com (I believe the server config file should contain this host)
@ravindranathakila
ravindranathakila / es.sh
Last active December 20, 2015 14:19
Updated to 0.90.2. Yet to test.
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
## NEW WAY / EASY WAY
#wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.2.deb
#sudo dpkg -i elasticsearch-0.90.2.deb