Skip to content

Instantly share code, notes, and snippets.

View yogendra's full-sized avatar

Yogendra Rampuria - Yogi yogendra

View GitHub Profile
public abstract class AbstractMathOperation implements MathOperation{
public void preOperate(Integer... values){
System.out.println("This is a pre operation ");
}
public void postOperate(Integer... values){
System.out.println("This is a post operation ");
}
public Integer operate(Integer... values){
preOperate(values);
@yogendra
yogendra / TimeTableManager.java
Created December 14, 2013 11:08
A Time Table Manager #java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
@yogendra
yogendra / nested-property.jks
Created November 22, 2013 07:45
Nested property getter and setter methods #Javascript #Utility
Object.prototype.setNested = function(s, v) {
s = s.replace(/\[(\w+)\]/g, '.$1'); // convert indexes to properties
s = s.replace(/^\./, ''); // strip a leading dot
var a = s.split('.');
o = this;
while (a.length) {
var n = a.shift();
if(a.length == 0){
o[n]=v;
return;
@yogendra
yogendra / httpserver.py
Last active December 29, 2015 00:19
Simple HTTP Post (Raw) Handling Server #Python #HTTP
import SimpleHTTPServer
import SocketServer
import cgi
import logging
import base64
import time
import os
ts = time.time()
uploadDir="upload/"
@yogendra
yogendra / index.html
Created May 10, 2013 18:09
A CodePen by Yogendra Rampuria - Yogi. Grouping table with bulk ops
<table id="deptInfo">
<thead>
<tr>
<th>Login</th>
<th>Account Name</th>
<th><span class="keep"><input type="checkbox" />Keep (<span class="count"><span class="selected">0</span>/<span class="total">0</span></span>) </span></th>
<th><span class="remove"><input type="checkbox" class="remove" />Remove (<span class="count"><span class="selected">0</span>/<span class="total">0</span></span>) </span></th>
</tr>
</thead>
<tbody class="dept-name">
@yogendra
yogendra / sujith.java
Created January 16, 2013 17:25
Java sample code - sujith
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPasswordField;
@yogendra
yogendra / jquery.bootstrap.js
Last active December 10, 2015 17:28
jQuery Related Codes #snippet
(function($){
$(function(){
${1}
});
})(jQuery);
package me.yogedra.test;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
public class ReadWriteObjects {