Skip to content

Instantly share code, notes, and snippets.

View faisal00813's full-sized avatar

Mohammad Abdul Sami faisal00813

  • Locuples | iindyverse
  • Hyderabad
View GitHub Profile
@faisal00813
faisal00813 / machine.js
Last active May 14, 2020 19:25
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'connection',
initial: 'disconnected',
context: {
mode: 0
},
states: {
disconnected: {
### Keybase proof
I hereby claim:
* I am faisal00813 on github.
* I am faisal00813 (https://keybase.io/faisal00813) on keybase.
* I have a public key ASD2NKIOMFWJ3B9K_NMQmUuXg0BREpV7AwRur1TbO12jqgo
To claim this, I am signing this object:
@faisal00813
faisal00813 / rocksdb.rb
Last active October 11, 2018 07:36
Formulae for rocksdb 5.8.8
class Rocksdb < Formula
desc "Embeddable, persistent key-value store for fast storage"
homepage "https://rocksdb.org/"
url "https://github.com/facebook/rocksdb/archive/rocksdb-5.8.8.tar.gz"
sha256 "51adb8e265c19a22281598157b097105ea187589070baaf7ac714a649c423070"
bottle do
cellar :any
sha256 "df69fa36b2b025f62cc0d30da46e072512d424cc66c242834fcfba7a60cb913c" => :mojave
sha256 "b4dd4f1c3324876dcf7a9524d6440a0891f162db3c19b97284100aa4b13cabbe" => :high_sierra
@faisal00813
faisal00813 / messagepack_client.js
Last active June 3, 2023 15:56
Client for sending the packed messagepack data to web server
const request = require('request')
const msgpack = require("msgpack-lite");
var packedData = msgpack.encode({
"str" : "Something",
"number" : 4.0,
"arr": ["one","two"],
"nClass": {
"doubleNumber" : 35.0,
"nums" : [34,23]
@faisal00813
faisal00813 / akkahttp_routes.scala
Last active November 21, 2017 06:55
Akka-http request handler for application/octet-stream
pathPrefix("user") {
path("msgPackTest") {
post {
extractRequest {
req =>
println(req.headers)
req.entity match {
case strict: HttpEntity.Strict =>
val resp = req.entity.dataBytes.runFold(ByteString.empty) { case (acc, b) => acc ++ b }
.map(x=> processMsgPackMsg(x.compact.toArray[Byte]))
source `which virtualenvwrapper.sh`
cd ~
rm Node*
workon latest-sovrin-master
nohup start_sovrin_node Node1 9701 9702 > Node1.log &
sleep 5
nohup start_sovrin_node Node2 9703 9704 > Node2.log &
sleep 5
nohup start_sovrin_node Node3 9705 9706 > Node3.log &
sleep 5
import thunk from 'redux-thunk';
import expect from 'expect';
describe('actions test', () => {
beforeAll(() => {
// do something here which you want to be executed before first test runs
}
it('editor.newPatient() should create a new patient', (done) => {
@faisal00813
faisal00813 / README.md
Created March 16, 2017 07:53
AllDiseasesAndConditions(CDC US)

README is empty

@faisal00813
faisal00813 / updateDateTimeFrom_ID
Last active February 7, 2017 14:13
Query for updating the timesatamp in document extracted from _Id field
db['your-collection'].find().forEach(function (doc){
d = doc._id.getTimestamp();
doc.visitedOn = d;
db['your-collection'].update({"_id":doc._id},doc,{upsert:true});
print(d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate() + " " + d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds()) })
@faisal00813
faisal00813 / String Substitution.scala
Last active November 7, 2016 10:33
Substitues the variable with the value provided
/**code taken from http://stackoverflow.com/a/4051500/845019
* substitutes the string with #{variableName} format
*/
implicit def RichFormatter(string: String) = new {
def richFormat(replacement: Map[String, Any]) =
(string /: replacement) { (res, entry) => res.replaceAll("#\\{%s\\}".format(entry._1), entry._2.toString) }
}