Skip to content

Instantly share code, notes, and snippets.

View deepak's full-sized avatar

Deepak Kannan deepak

View GitHub Profile
@deepak
deepak / calling different methods in sub-class.java
Last active January 4, 2016 07:31
calling different methods in sub-class (ruby)
public class Foo {
public String ping() {
return "ping";
}
public String pong() {
return "pong";
}
}
@deepak
deepak / needed hubot commands.md
Last active January 1, 2016 07:02
needed hubot commands

needed hubot commands

leaves calendar

  • add leave to calendar. leave needs to be added to multiple calendars, companies and projects
  • see leaves calendar

todo

@deepak
deepak / why Fixnum#respond_to?(:dup) is not false.md
Last active December 31, 2015 06:24
why Fixnum#respond_to?(:dup) is not false
@deepak
deepak / prepend-does-not-work-with-inheritance.rb
Created December 11, 2015 09:59
prepend does not work with inheritance
# ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
# from https://bugs.ruby-lang.org/issues/11301
module M
end
class A
prepend M
end
@deepak
deepak / cannot-reopen-class-and-modify-include-to-prepend.rb
Last active December 11, 2015 09:32
cannot reopen class and modify include to prepend
# If i have a class, which includes a module
# Now i cannot reopen the class and prepend the same module
# ran on ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
class Base; end
module M1; end
module M2; end
class C1 < Base; end
@deepak
deepak / spring hello world.java
Last active November 18, 2015 08:07
spring hello world
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
public class Main {
public static void main(String[] args) {
ApplicationContext context = new FileSystemXmlApplicationContext("spring.xml");
Triangle shape = (Triangle) context.getBean("triangle");
shape.draw();
@deepak
deepak / download-list-of-links.wget.txt
Created November 4, 2015 11:09
how to download a list of links
@deepak
deepak / super_in_module.rb
Created October 26, 2015 09:04
include and prepend in ruby along with super
module A
def say
puts "in A"
super
end
end
module B
def say
puts "in B"
@deepak
deepak / install-mit-schema-for-SICP.md
Last active May 10, 2021 19:51
installing MIT-scheme for doing SICP

installing MIT Schema

The SICP page recommends MIT scheme,
so that is what we will use

to install it, on Apple OSX using Homebrew:

  brew tap x11
  brew cask install xquartz
@deepak
deepak / ci.sh
Created September 1, 2015 07:47
CI script for a rails project
#!/bin/bash
set -e
export RAILS_ENV=test
export DISABLE_SPRING=1
source /usr/local/rvm/scripts/rvm
rvm use ruby-2.2.1
bundle install --path=vendor > log/bundle_install.log