Skip to content

Instantly share code, notes, and snippets.

View gansai's full-sized avatar
🎯
Focusing

Ganesh S gansai

🎯
Focusing
View GitHub Profile
@gansai
gansai / timepass.c
Created October 18, 2014 14:00
time pass code
#include<stdlib.h>
int main()
{
printf("Hi and Bye");
return 0;
}
@gansai
gansai / Trailer
Created October 20, 2014 07:07
Nice trailer showing important things
I just checked http://addyosmani.com/blog/
The trailer of the page containing the following sounded interesting:
Fundamentals
First do it, then do it right, then do it better. This is one fundamental I always keep in mind when developing anything.
If you're a developer wishing to learn something new, regardless of skill-level, remember that as important as it is to read, it's equally as important to get out there and *do*.
Create a new gist or JSBin, pop open the console and experiment. It's effing fun.
@gansai
gansai / ListeningExecutorServiceIllus.java
Created September 2, 2015 04:42
Illustration of ListeningExecutorService
class ListeningExecutorServiceIllus
{
//Just for illustration purpose, not a working version.
//Creation of ListeningExecutorService
class MyCallbackRunnable implements Runnable
{
@Override
@gansai
gansai / TweetMain.java
Created October 3, 2015 11:49
Post a Tweet from Java code
import java.util.List;
import twitter4j.Status;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.conf.ConfigurationBuilder;
public class TweetMain {
public static void main(String[] args) {
@gansai
gansai / hello.erl
Created October 3, 2015 13:06
Printing Hello World in Erlang
-module(hello).
-export([hello/0]).
hello()-> io:fwrite("Hello World\n").
@gansai
gansai / hello.erl
Created October 4, 2015 11:00
Illustration for running Erlang code from Intellij IDEA
-module(hello).
%% API
-export([hello/0]).
hello() -> io:fwrite("Hi. This is my first Erlang Program.\n").
@gansai
gansai / TweetMain.java
Last active October 4, 2015 15:10
Illustration on how to retrieve home timeline from twitter using Java code
import java.util.List;
import twitter4j.Status;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.conf.ConfigurationBuilder;
public class TweetMain {
public static void main(String[] args) {
@gansai
gansai / first.rb
Created October 5, 2015 18:49
Ruby code to illustrate basic programming
#This is my first Ruby code
print "Hi Everyone. How are you?"
puts "Enter a value"
num = gets.to_i
puts "Enter another value"
num_2 = gets.to_i
puts num.to_s + " + " + num_2.to_s + " = " + (num + num_2).to_s
@gansai
gansai / FindPairSum_Brute.java
Last active October 11, 2015 08:03
Given an array and a sum x, find a pair in array which sums up to x. (Brute-force)
/**
* Created by gansai on 11/10/15.
*/
public class FindPairSum_Brute {
public static void main(String args[])
{
int array[] = new int[] { 1, 43, 2, 55, 21, 87, 9 };
int sum = 76;
boolean foundPair = false;
@gansai
gansai / FindPairSum_Sorted.java
Created October 11, 2015 08:04
Given an array, find a pair which sums up to a number (Sorted array solution)
import java.util.*;
/**
* Created by gansai on 11/10/15.
*/
public class FindPairSum_Sorted {
public static void main(String args[])
{
Integer array[] = new Integer[] { 1, 43, 2, 55, 21, 87, 9 };