Skip to content

Instantly share code, notes, and snippets.

View vinodkashyap's full-sized avatar

Vinod Kumar Kashyap vinodkashyap

View GitHub Profile
Verifying my Blockstack ID is secured with the address 14J2YmGJUtLW2B3QPpyDhKeNShC6FKAFQT https://explorer.blockstack.org/address/14J2YmGJUtLW2B3QPpyDhKeNShC6FKAFQT

Keybase proof

I hereby claim:

  • I am vinodkashyap on github.
  • I am vinodkashyap (https://keybase.io/vinodkashyap) on keybase.
  • I have a public key ASAnhxOo98CveIdb8KlK1t5aRZDkTdcqBL7oSC39gBwVogo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am vinodkashyap on github.
  • I am vinodkashyap (https://keybase.io/vinodkashyap) on keybase.
  • I have a public key ASAnhxOo98CveIdb8KlK1t5aRZDkTdcqBL7oSC39gBwVogo

To claim this, I am signing this object:

@vinodkashyap
vinodkashyap / GetImage.java
Created November 16, 2015 07:07
Get Height and Width of Image in Java
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
public class GetImage {
public static void main(String[] args) {
try {
import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashSet;
import java.util.Set;
public class RandomString {
@vinodkashyap
vinodkashyap / JavaUtilToSqlDateConvert.txt
Last active November 16, 2015 06:46
Convert java.util.Date to java.sql.Date
public static Date convertToSqlDate(java.util.Date utilDate) {
Date sqlDate = new Date(utilDate.getTime());
return sqlDate;
}

Keybase proof

I hereby claim:

  • I am vinodkashyap on github.
  • I am vinodkashyap (https://keybase.io/vinodkashyap) on keybase.
  • I have a public key whose fingerprint is AA3F B6F7 DB35 972D FFF9 AC8C A20F D765 32CE 91D9

To claim this, I am signing this object:

#Four Ways To Do Pub/Sub With jQuery and jQuery UI (in the future)

Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.

(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)

##Option 1: Using jQuery 1.7's $.Callbacks() feature:

$.Callbacks are a multi-purpose callbacks list object which can be used as a base layer to build new functionality including simple publish/subscribe systems. We haven't yet released the API documentation for this feature just yet, but for more information on it (including lots of examples), see my post on $.Callbacks() here: