Skip to content

Instantly share code, notes, and snippets.

View arunk's full-sized avatar

Arun Kumar arunk

View GitHub Profile

Keybase proof

I hereby claim:

  • I am arunk on github.
  • I am arunk (https://keybase.io/arunk) on keybase.
  • I have a public key ASD9KDKbOxOunc-99tW7_vRl-vHNijGgw3djCJgXz5eYPgo

To claim this, I am signing this object:

@arunk
arunk / README
Last active August 29, 2015 13:57
Introduction
============
First gistup using bl.ocks.org
@arunk
arunk / app.js
Last active December 15, 2015 08:59
passport-local-mongoose simple config
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, user = require('./routes/user')
, http = require('http')
, path = require('path')
, passport = require('passport'),
@arunk
arunk / gist:4597421
Created January 22, 2013 19:11
how do i refer to the callback of each element in the list rather than the callback of the last element?
list = [
{
data: 1
callback: function(res)...
},{
data: 2
callback: function(res)...
}
]
import java.util.ArrayList #Tried this with and without quotes.
#Removing the above import line produces a working java .class file
class Test
def self.main(args:String[]):void
puts "Hello"
end
end
##The Test.java file produced with mirah -j
@arunk
arunk / Test.mirah
Created August 19, 2011 06:03
Simple Mirah class
class Test
def self.main(args: String[])
puts args.length # signature of this method is public static java.io.PrintStream main(java.lang.String[] args)
#self #according to http://www.mirah.org/wiki/MirahHowto , this should change the method signature to
#return void. instead it changes it to - public static Test main(...
end
end
@arunk
arunk / rakelog
Created March 10, 2011 18:32
Rake task log
rake aborted!
wrong number of arguments for constructor
/home/arun/Projects/aolportal/Rakefile:87:in `(root)'
org/jruby/RubyDir.java:212:in `glob'
/home/arun/Projects/aolportal/Rakefile:86:in `(root)'
org/jruby/RubyProc.java:268:in `call'
org/jruby/RubyProc.java:228:in `call'
/home/arun/.rvm/gems/jruby-1.6.0.RC3/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
org/jruby/RubyArray.java:1572:in `each'
/home/arun/.rvm/gems/jruby-1.6.0.RC3/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
@arunk
arunk / rake-2203.rb
Created March 10, 2011 17:37
Line 2503 is rake_original_const_missing(const_name) at the bottom last else.
['--execute-print', '-p CODE', "Execute some Ruby code, print the result, then exit.",
lambda { |value|
puts eval(value) ##Line 2223 - previous call in stack trace.
exit
}
],
@arunk
arunk / RakeTask.log
Created March 10, 2011 15:22
Output of rake task to generate static html
$ jruby -S rake --trace -cp WEB-INF/lib/dubious.jar generate_static
rake aborted!
uninitialized constant Rake::Application::WEB
org/jruby/RubyModule.java:2528:in `const_missing'
/home/arun/bldr/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing'
(eval):1:in `standard_rake_options'
org/jruby/RubyKernel.java:1088:in `eval'
/home/arun/bldr/jruby-1.6.0.RC2/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2223:in `standard_rake_options'
org/jruby/RubyProc.java:268:in `call'
org/jruby/RubyProc.java:228:in `call'
@arunk
arunk / staticpage.rb
Created March 10, 2011 01:26
StaticPage Generator
require 'erb'
java_import dubious.ActionController
class StaticPage < ActionController
def initialize( file = '')
@file = file
parse_file()
end