Skip to content

Instantly share code, notes, and snippets.

View maleck13's full-sized avatar

Craig Brookes maleck13

View GitHub Profile
- cluster
{
"name": "new team from clusteradmin",
"desc": "",
"perms": {
},
"business-objects": {
"cluster": ["development"]
@maleck13
maleck13 / gist:f50e4b00d17caf1d30bf
Created January 19, 2015 22:16
solution vers comparision
public class Solution {
public int compareVersion(String version1, String version2){
String[] parts1;
String[] parts2;
if(version1.contains(".")){
parts1 = version1.split("\\.");
}else{
parts1 = new String[]{version1};
}
if(version2.contains(".")){
@maleck13
maleck13 / gist:5b88ba21a647233da25f
Created January 20, 2015 15:07
solve merge to unsorted arrays and sort
var arr11 = [1,2,7,10,20,1000,3,14]
var arr22 = [2,7,110,200,10100,13,14,9];
var arr1 = arr11.concat(arr22);
for(var i=1; i < arr1.length; i++){
var cVal = arr1[i];
var j=i;
@Around("execution(* org.tssg.millicore.model.widg.ProjectDaoImpl.listWithApps(..))")
public List<Project> aroundProjectListWithApps(ProceedingJoinPoint pjp) throws Throwable{
Object[] args=pjp.getArgs();
String name = pjp.getSignature().getName();
System.out.println("starting timing around " + name);
UserContext u = null;
for(Object a : args){
if(a instanceof UserContext){
u = (UserContext)a;
Explain.startTimer(u.getExplain(), name);
# Memory Settings
JAVA_OPTS="$JAVA_OPTS -Xms100m -Xmx2048m -XX:MaxPermSize=256m"
# Define some MilliCore parameters
JAVA_OPTS="$JAVA_OPTS -Dfeedhenry.node=node01 -Dfh.cluster.config=/etc/feedhenry/core/cluster-config.properties -Dfh.logdir=/var/log/feedhenry"
# JDWP debugging
JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9000,suspend=n"
childproc.exec("dig fh-aaa-mongodb.default.cluster.local A +short", function (err, stdout, stderr) {
if (stderr) {
console.log("error with getting replicas", stderr);
} else {
var ips = stdout.split("\n");
var cleanIps = [];
for (var i = 0; i < ips.length; i++) {
if (ips[i] && "" !== ips[i]) {
cleanIps[i] = ips[i].trim();
@maleck13
maleck13 / interviewProblem.js
Created October 7, 2015 20:28
code question
function remoteMathService(cb){
var one;
var two;
callOneService(function (err,num){
one = num;
});
callTwoService(function (err, num){
two = num;
});
process.env.FH_MESSAGING_REALTIME_ENABLED = true
var mbaasApi = require('fh-mbaas-api');
var express = require('express');
var mbaasExpress = mbaasApi.mbaasExpress();
var cors = require('cors');
// list the endpoints which you want to make securable here
var securableEndpoints;
// fhlint-begin: securable-endpoints
securableEndpoints = ['/hello'];
package main
import (
"io/ioutil"
"os"
"fmt"
"regexp"
)
func CountFloors()(int,error){
install package control
https://github.com/ironcladlou/GoTools