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
db.insert({data: 1000}, function(err) {
//do something when inserted
})
console.log("I don't wait");
info it worked if it ends with ok
verbose cli [ 'node', '/usr/local/bin/npm', 'install', '-g' ]
info using npm@1.0.10
info using node@v0.4.5
verbose config file /home/arunoda/.npmrc
verbose config file /usr/local/etc/npmrc
silly exec /usr/local/bin/node "/usr/local/lib/node_modules/npm/bin/npm-get-uid-gid.js" "nobody" 1000
silly output from getuid/gid {"uid":65534,"gid":1000}
silly output from getuid/gid
verbose into /usr/local/lib [ '.' ]
@arunoda
arunoda / System Info
Created September 12, 2011 11:35
Node HTTP Proxy Benchmark
OS: Ubuntu 10.10
NodeJS: v0.4.10
RAM: 2GB
Processer: Core 2 Duo 2.0 Ghz
@arunoda
arunoda / gist:1229406
Created September 20, 2011 15:26
Java Script Data Structures
// Arrays
var aaa = [];
// Stack
var aa = [10];
aa.push(20);
aa.pop(); //gets 20
@arunoda
arunoda / pre.sh
Created October 18, 2011 20:20
Nariya Server
rake
@arunoda
arunoda / strict.js
Created October 29, 2011 04:22
Strict Mode Test
function a() {
"use strict"
function b() {
console.log(arguments.callee.caller);
}
b();
}
a();
@arunoda
arunoda / ab-test-to-sl-server.txt
Created January 10, 2012 13:08
Benchmark Appzone via amazon EC2
ab -n 100 http://www.mit.kln.ac.lk/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.mit.kln.ac.lk (be patient).....done
Server Software: Apache/2.2.10
Server Hostname: www.mit.kln.ac.lk
@arunoda
arunoda / index.html
Created April 7, 2012 06:40
How kodeincloud HTML5 API looks like
<!DOCTYPE html>
<html>
<head>
<title>kodeincloud HTML5</title>
<script type="text/javascript" src="http://static.kodeincloud.com/html5.min.js?appkey=3f76818f507fe7eb6422bd0703c64c88"></script>
<script type="text/javascript">
kic.invoke('hello', {name: "arunoda susiripala"}, function(err, resp) {
@arunoda
arunoda / graphql-cache-demo.js
Last active November 25, 2015 15:39
This is a demo of how to write a simple app with our GraphQL Cache.
const GraphQLCache = require('graphql-cache');
const HttpTransport = require('graphql-cache-http-transport');
const React = require('react');
const ReactDOM = require('react-dom');
const Cache = new GraphQLCache({
transport: new HttpTransport('/graphql');
});
// Create the fragment where we can use later on
import Lokka from 'lokka';
import HttpTransport from 'lokka-transport-http';
const client = new Lokka({
transport: new HttpTransport('http://graphql-swapi.parseapp.com/')
});