Skip to content

Instantly share code, notes, and snippets.

View arunoda's full-sized avatar
👨‍🍳
Cooking something new

Arunoda Susiripala arunoda

👨‍🍳
Cooking something new
View GitHub Profile
@arunoda
arunoda / cpu-watch.js
Last active August 29, 2015 13:56
Lookup CPU usage in details
/*
USAGE: node cpu-watch.js <pid> <how-many-minutes>
*/
var fs = require('fs');
var format = require('util').format;
var PID = process.env.PID || process.argv[2];
if(!PID) throw new Error('No PIC Provided!');
var ENDIN_MINUTES = process.env.ENDIN_MINUTES || process.argv[3];
var DDPClient = require('ddp');
var totalClients = 0;
var postsList = 0;
var postsListUsers = 0;
var postsList
function createClient(closeTimeout) {
console.log('CREATING....', closeTimeout);
var client = new DDPClient({
<head>
<title>abc</title>
</head>
<body>
{{#sourceCode}}
<template name="books">
<input type="text" placeholder="Search..." value="{{booksSearchQuery}}">
{{#if searchResults.count}}
{
_id: "7Tij2HTGqhrRE3k78",
created: ISODate("2014-02-07T04:04:33.266Z"),
initialDataReceived: true,
name: "kadira-ui",
owner: "vapXLdykrravRPua8",
secret: "bfda539b-cf42-469a-9847-49f11883858f",
plan: "pro",
planToUSD: 0.003,
collaborators: [],
ServiceConfiguration.configurations.remove({
service: "meteor-developer"
});
if(Meteor.settings.meteorDevelopers) {
var meteorDevelopersInfo = Meteor.settings.meteorDevelopers;
} else {
var meteorDevelopersInfo = {
clientId: "HcempmSyaawiyb4G4",
secret: "snC3snsmTebC8HHCwwhqhHaAzAFxtFsQRL"
var graphql = require('graphql');
var userType = new graphql.GraphQLObjectType({
name: 'User',
fields: () => ({
id: {type: graphql.GraphQLString},
name: {type: graphql.GraphQLString},
friends: {
type: new graphql.GraphQLList(userType),
args: {
@arunoda
arunoda / app.js
Created April 7, 2011 08:13
MongoDB Helper using QBox
var mongo = require("./mongoHelper").connect("localhost", 27017, "test");
mongo.collection("collname", function(coll) {
});
var http = require('http');
var sys = require('sys');
function request()
{
var host = 'google.com';
var client = http.createClient(443, host, true);
var request = client.request('GET', '/',
{'host': host});
request.end();
var redis = require('redis');
var cli = redis.createClient();
cli.on('error', function(err) {
console.log('Err:' + err);
});
function addWorker() {
console.log('adding worker again');
cli.blpop('nl', 0, function(err, data) {
var redis = require('redis');
var cli = redis.createClient();
cli.on('error', function(err) {
console.log('Err:' + err);
});
function addWorker() {
console.log('adding worker again');
cli.blpop('nl', 0, function(err, data) {