Skip to content

Instantly share code, notes, and snippets.

Dustin Deus StarpTech

Block or report user

Report or block StarpTech

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@StarpTech
StarpTech / bundle-writer-example.js
Last active Feb 14, 2017
How to create a bundle writer in LassoJs
View bundle-writer-example.js
// ************************************
// ***** bundle-writer-example.js *****
//*************************************
var myWriter = require('./bundle-writer');
module.exports = function (myLasso, pluginConfig) {
myLasso.config.writer = myWriter(pluginConfig, myLasso.config);
};
// ****************************
View request-reply-perf-realworld.js
var nc1 = require('../lib/nats').connect();
var nc2 = require('../lib/nats').connect();
var os = require('os')
///////////////////////////////////////
// Request Performance
///////////////////////////////////////
var start;
var loop = 100000;
var hash = 1000;
@StarpTech
StarpTech / memory-leak-pub.js
Last active Jan 18, 2017
Memory leak Node-Nats
View memory-leak-pub.js
var nats = require('../lib/nats').connect();
///////////////////////////////////////
// Publish Performance
//
// Setup:
// NodeJs: 6.9.2, Windows 10
///////////////////////////////////////
@StarpTech
StarpTech / transaction-builder.js
Last active Dec 16, 2015
Transaction Builder for Orientdb in NodeJs
View transaction-builder.js
/* ----------------------------Transaction Builder-------------------------------
Spec: https://github.com/orientechnologies/orientdb/wiki/SQL-batch
- Bluebird promise library
EXAMPLE:
var tx = new Transaction();
var s0 = tx.add(query1);
var s1 = tx.add(query2); //In query2 you can use the result of query1 with $0 ($<index>)
@StarpTech
StarpTech / underlyingArray.go
Last active Dec 15, 2015
Get the data of an Array by a Slice.
View underlyingArray.go
var c int = 1
intSlice := []int{100, 1, 2, 3, 4}
newSlice := intSlice[c:]
fmt.Printf("Points to the Slice %p\n",&intSlice) //0xc20005d020
fmt.Printf("Points to the first Element of the underlying Array: %d\n",&intSlice[0]) //833223995872
@StarpTech
StarpTech / funcAnalyse.go
Last active Dec 15, 2015
Fun with the reflection package to analyse any function.
View funcAnalyse.go
package main
import (
"fmt"
"reflect"
"strconv"
)
@StarpTech
StarpTech / Javascript-execution-context.md
Last active Dec 14, 2015
Javascript execution-context
View Javascript-execution-context.md
@StarpTech
StarpTech / getJSONVal.go
Last active Dec 14, 2015
Get nested JSON value dynamically by tail-recursion and type-assertions
View getJSONVal.go
package main
import (
"fmt"
)
func GetStructField(f interface{},path []string) interface{} {
rangeOver := f.( map[string]interface{})
counter := 0
maxLen := len(path)-1
You can’t perform that action at this time.