Skip to content

Instantly share code, notes, and snippets.

View Nearhan's full-sized avatar

Farhan Syed Nearhan

View GitHub Profile
package core
import (
"database/sql"
"encoding/json"
"time"
"github.com/lib/pq"
uuid "github.com/satori/go.uuid"
"go.uber.org/zap"
@Nearhan
Nearhan / project.go
Created June 9, 2018 20:17
project struct
package project
import (
"encoding/json"
"time"
"github.com/satori/go.uuid"
"gitlab.qntfy.com/qcr/drago/core"
"gitlab.qntfy.com/qcr/drago/networks"
)

ProtoFile

syntax = "proto3";
package server;

message Payload {
    string name = 1;
    string id = 2;
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"sync"
)
@Nearhan
Nearhan / test stats d
Created March 1, 2016 18:38
test stats d
from datadog import statsd
statsd.increment('test.test.test')
statsd.event('This is a test Event', 'This is a a Test Event')
<?xml version="1.0" encoding="UTF-8" ?>
<Response>
<Say>I will pause 10 seconds starting now!</Say>
<Pause length="10"/>
<Say>I just paused 10 seconds</Say>
</Response>

Keybase proof

I hereby claim:

  • I am nearhan on github.
  • I am nearhan (https://keybase.io/nearhan) on keybase.
  • I have a public key whose fingerprint is E0C0 DBED DE06 6619 DE1A 9046 AFBB 0235 3BF3 88AB

To claim this, I am signing this object:

@Nearhan
Nearhan / gist:978182b5238a5262e17b
Created April 3, 2015 19:38
Add Tags To Feed Items
  • How to add Tags from the Command Line

    • maven run python trackmaven/manage.py create_test_tags --ws= 1 --tags=77 --num=1000
    • this will add tweet objects to the es_index
# you can override this using by setting a system property, for example -Des.logger.level=DEBUG
es.logger.level: INFO
rootLogger: ${es.logger.level}, console, file
logger:
# log action execution errors for easier debugging
action: DEBUG
# reduce the logging for aws, too much is logged under the default INFO
com.amazonaws: WARN
# gateway
@Nearhan
Nearhan / ES
Created January 6, 2015 13:46
ES
body = {
"aggs" : {
"hashtags" : {
"terms" : {
"field" : "hashtags",
"size": 0
}
}
}
}