Thursday, December 31, 2009

My New Year Resolutions

  1. Get the hang of MVC frameworks and create a working platform using CakePHP.
  2. Move to my own domain.
  3. Create a firefox addon
  4. Create chrome extension.
  5. Design a logo, a letterhead and VCs.
You can also work on them. They are quite generaal resolutions. :)

Thursday, December 3, 2009

Variable Height Iframes

I know Iframes suck! And they must be avoided as much as possible... but the fact is that they are sometimes the easiest and/or the only possible way.(GMail is all iframes). One thing that sucks about Iframes is that it's  height is constant, independent of the content it is holding. And hence either there is some extra whitespace or a very irritating scroll bar.

Here is a script that will help you make a scrollbar free iframe:


function setHeight(ele) {
saveele = ele;
var oDoc = (ele.contentWindow || ele.contentDocument);
if (oDoc.document) oDoc = oDoc.document;

var D = oDoc;
h = Math.max(
Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
Math.max(D.body.clientHeight, D.documentElement.clientHeight)
);
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
if(is_chrome) {
h = oDoc.height;
}
ele.height = h;
}


Here is a working example.

I hope it helps :)

Google Search with Text Commands


What it does?

Gives you an option to search images, videos, youtube and wikipedia right from google homepage WITHOUT any additional clicks

Format of various queries:

Search Type
Prefix/Command
Example
Destination Domain
Normal Search
Nothing
Hello
google.com
Image Search
;i
;i Hello
images.google.com
Video Search
;v
;v Hello
videos.google.com
Youtube Search
;y
;y Hello
youtube.com
Wikipedia Search
;w
;w Hello
wikipedia.org


How does it work?

It redirects the page to mentioned locations after appending queries if the query text is preceded by ;i or ;v or ;w or ;y

How to Install it?

Step 0: Install Greasemonkey (It's a Firefox Addon)
Step 1: Install My Script


I hope it will help. If you think there are more options that are needed for faster searches, do leave a message.


Search Tip

Well, we all search for definitions now and then. What we do is we go to answers.com or wikipedia or i-am-too-lazy-to-list-them-all.
Easy way:
Google this 
define:WHATEVER_YOU_WANT



P.S.: Greasemonkey is awesome

Wednesday, November 18, 2009

Fish Wrangler Auto Add Crew/Neighbours

What it does?
Open the Neighbors Tab... And leave the Tab open. If there are any users with "Add X as Neighbor" option, this will add him/her.





How does it work?
Simple, Fist list down all the friends. Find one with words "Not in crew" but not with "Request Sent" Find the input button whose class is "inputbutton request_form_submit" and click on it. Then weight for the confirmation box to appear, and click on "Send"

How to Install?
(0) Install Greasemonkey Firefox Addon from here.
(1) Install The script from here.

Any suggestions and comments are welcome.

YoVille Auto Add Neighbours

What it does?
Open the Neighbors Tab... And leave the Tab open. If there are any users with "Add X as Neighbor" option, this will add him/her.




How does it work?
Simple, Find the input button whose value start with "Add" and click on it. Then weight for the confirmation box to appear, and click on "Send"

How to Install?
(0) Install Greasemonkey Firefox Addon from here.
(1) Install The script from here.

Any suggestions and comments are welcome.

Wednesday, November 11, 2009

Café World Auto Add Neighbours

What it does?
Open the Neighbors Tab... And leave the Tab open. If there are any users with "Add X as Neighbor" option, this will add him/her.


How does it work?
Simple, Find the input button whose value start with "Add" and click on it. Then weight for the confirmation box to appear, and click on "Send"

How to Install?
(0) Install Greasemonkey Firefox Addon from here.
(1) Install The script from here.

Any suggestions and comments are welcome.

Tuesday, November 10, 2009

Impact

I like impact. It's compact and clear and crisp and awesome.



PS:
I am not supposed to waste time on wallpapers, but I think it's my basic instinct.

Tuesday, October 27, 2009

FarmVille Auto Add Neighbors

Another Facebook Greasemonkey script. It's fun to code with greasemonkey, you don't have worry about the looks etc, just specify the things, and greasemonkey will handle it for you.

What it does?
Open the Neighbors Tab... And leave the Tab open. If there are any users with "Add X as Neighbor" option, this will add him/her.

How does it work?
Simple, Find the input button whose value start with "Add" and click on it. Then weight for the confirmation box to appear, and click on "Send"

How to Install?
(0) Install Greasemonkey Firefox Addon from here.
(1) Install The script from here.

Any suggestions and comments are welcome.

Friday, September 18, 2009

'Select All' for Facebook

What does this script do?

Whenever you want to suggest a page to your friends, you have to click them one by one. This script will add a "Click Them" button at the end of the dialog box. You can also select the range of friends to select but that's optional.

Known Issues

  • Requires a page refresh if the script is already used once.

Screenshots





Installation

Requires GreaseMonkey Firefox Addon
Install It from here

Last Update:
September 9, 2010. Status: Working.


Sunday, September 13, 2009

GMail Left Aligned Chat Boxes

Long Name Na!
That's because this script is for a very specific purpose:
Left Aligned Chat Boxes
Thanks to Ishan Srivastav for the idea... There was no google labs feature so i wrote a simple greasemonkey script.

To install it: VISIT THIS URL

Monday, September 7, 2009

NoClick Greasemonkey Script

I just tweeked the original script because it was not working on FF3.5
I thought of making changes in the original script that's here but i couldnot find the link to upload it
so I made a new page for it... There is a one click installer on that page.
What is it supposed to do?
Nothing much! It just Automatically clicks the link if you hover on it for a long time...

What might suck?
  1. So the thing is that i removed the onclick functionality so as to make it work...
  2. + What if there are large images/links.... this will redirect you page if you forget to move your mouse away...
  3. The link color changes to blue.... if the background is blue, link will no longer be visible.
What can you do?
Keep changing it to make it appropriate for your speeds...
The change can be done on line number 19
colortimer = setTimeout(fade, 200, elem);
Increase speed by decreasing that number (200)
Decrease speed by increasing that number

BTW I have also hosted it on my homepages...

@Antariksh
Thanks :P

Saturday, August 15, 2009

Know your Mojo!


I don't exactly know when did Yahoo! launch this site but it's very new and very beautiful.

Know your Mojo! takes a twitter username and finds what type of twitter user you are...
The transitions are really very pleasant...

Each type or mojo has it's own avatar: a beautiful bird illustration.

You can also check out all the mojo's...

I am a matchmaker...
To know what it means and to know your own mojo...
Try this link: Yahoo! Know Your Mojo

P.S1: I think I am starting to like Y(ah)oo!
P.S2: Yahoo! has a new homepage too. Minimalistic (according to yahoo standards) is good. Colour Switcher works smoothly. Only if they used a very light 1px separater between the various news items in news feed....
P.S.3: It's all Javascript and AJAX... Feel Good Factor for me }:)
P.S.4: It seems like the Mojo Logo is giving us a finger!!! :D

Shadows Rock!

I love shadows! They are just too frigging awesome... right?
I made this in 120 secs....

Shadows Rock!

Tuesday, June 2, 2009

Firefox Profiles

Firefox is the most widely modern browser. (IE... what are you talking about??)
One of the main reasons behind massive popularity of Firefox is it's capability to have additional plugins and add-ons.
Firebug, DownThemAll, Xmarks, Stumble, Google, Yahoo, Alexa, ReadIt!, Web Developer Toolbar, IE Tab and what not!

But unfortunately, some of us do not own massive 8GB - QuadCore Giants and running firefox with all these add-ons. So what happens is, FF starts eating a lot of RAM. To avoid this:
Use Firefox Profiles
Basically have 2-3 profiles: One for all the heavy technical work: Install firebug, YSlow!, Xmarks Alexa etc... keep another one with stumble-xmarks-google...It will make surfing a little less painful. :)

This is also useful you are developing some firefox add-on and you don't want it to screw your settings or if you want to log in into another google account from the same comp and IE is as non existent to you as it is to me.

Here are the steps to make a new profile and desktop icons for the same:
  1. For Vista Users: Open the start menu and in the textbox type the command given below.
    firefox -ProfileManager
    XP users can use RUN for the same. Linux users can use command shell.
  2. Use "Create Profile..."
  3. In profile name, the easier way out is to use a single word say 'profile2' ('default' is obviously the default profile)
  4. And Exit!

Now we need to create a Firefox Icon that directly opens a specific profile.
  1. Create a copy of the firefox icon on the desktop.
  2. Rename one of them as default the other one as profile2. (You can name them whatever you want)
  3. Right click the first one and choose properties.
  4. In Target, add the following parameteres add the end -p "default" -no-remote. The final path looks like this:
    C:\...SOME PATH...\Firefox\firefox.exe -P "default" -no-remote

    the -P "default" opens up default profile.
    -no-remote is essential otherwise you won't be able to open two different profiles at the same time.
  5. Similarly, edit the second desktop icon.
I hope this post proves useful.

Monday, June 1, 2009

Bounce - Javascript!

It was 7:15 in the morning and I was about to sleep... but I couldn't. I had too much on my mind! Last night I saw the google I/O keynotes. Some really fascinating technologies and examples of pure brilliance! The day one video started with some really cool interactive animations inside browser... I think they were either canvas or flash, most probably the canvas element because one of the new feature they showcased was the <canvas> element.

So, there was this animation where balls fall from a point and the user draws some lines from where they bounce back. I thought of implementing that animation. Although that animation is not very difficult but because of my morning laziness i switched to a even more easier animation:

I think it's not 100% accurate probably due to floating point precision error or may be because of my stupidity.... :D

Anyways, if you like the thing... do leave a comment

PS: I am doing too much Javascript these days! o_O
PS2: Google I/O was awesome... GWT is awesome... Google Wave will be awesome.
And yeah... google is god!

Wednesday, May 27, 2009

gStat - Javascript

We all use gmail and google chat. And we all love to tell people what we are doing.
Now a days, one of the common thing you will notice is that status messages are now a very improtant medium to lure people to talk to you or visit a link or just tease them.
But there is one really irritating thing about google chat's status messages. It's very difficult to format them.
So I thought may be this will help:


It's not very user friendly, but something is always better than nothing. ;)


PS: It's not perfect yet. So the end code might require a slight nudging: removing a whitespace from here or adding one

Monday, May 25, 2009

ROT13 Bookmarklet for Wordpress.com

Javascript bookmarklets is a very useful technique.
I have used them a lot while playing tribal wars. The basic rule is typing "Javascript:WHATEVER_FUCTION_YOU_WANT_TO_EXECUTE" in address bar executes the fucntion.
adding void(0) at the end of the function calls prevents redirection to a new page (containing nothing but the return value of the last function).

So here we go, the following link has a js that will rotate the text inside the comment textbox (textarea to be precise).

--: ROT13 :--


Bookmark it... (Easiest way: Drag drop the above hyperlink to your bookmarks toolbar)
----------------------------------------------------------------
Update: I was informed that there is a bug in the code.... it rotates an endline character to %a
So, here is the updated code for ROT 13

Friday, May 15, 2009

Remake

Jquery UI is a very beautiful package. And PHP is of obviously very powerful.
One can do real magic using them together.
I made here is very basic (just like the other stuff I have done before).

The Remake Image Puzzle

From a image hosted somewhere on net and a few parameters it creates a puzzle.
The best part is... One can drag drop the boxes to solve them.
Although it's crackable, one can make it perfect by using PHP GD.

The option's not available on these free servers and hence I couldn't.

The working?
Takes an Image
Makes floating <li> elements with that image as background
Use PHP to randomize their order and then the background position.
Use Jquery UI's sortable feature on the <ul>

[Demo] [Download Source Code] <-- It feels good, posting stuff like this. :D

Wednesday, May 13, 2009

Rot13 - Widget

Hey all!
I hope you will find this widget helpful...
Please try to keep the SM and HC links, they are pretty small :)


For blogger users:
Try this button:


OR
In Layout > Add Gadget > HTML/Javascript
Paste this line:
<iframe allowtransparency="true" width="200" frameborder="0" src="http://mayanksinghal.110mb.com/rot13.html" name="myframe" height="200">
</iframe>


Example:


The actual code:
[rot13.txt]

If there is a bug, leave a comment.
Vs vg' jbex'f svar, yrnir n pbzzrag :C

Tuesday, May 12, 2009

Building Back...

OK! So I just recovered my machine. It sucks...!
Bringing my lappy back to the previous condition will take weeks... Between I'll name some softwares that I used and I hate not to have them on my machine right now...

1) Firefox!
Partially because IE sucks
Partially because of the add-ons on FireFox

2) VLC
400% volume, low RAM usage. VLC rocks! I don't know why some people keep using Window's Media Player for videos...(especially the girls). For music, I would suggest Media Player over iTunes (But, I haven't used iTunes a lot so... :) )

3) Notepad++
Just awesome. Light and very useful. With all the highlighting for CSS, Javascript, HTML, XML, PHP and even C++, Java etc., NP++'s an awesome development tool for those who like to stick with the basics. (I miss Gedit... People said Eclipse is awesome... I donno... but autocomplete, sounds friendly)

4) Firebug and XMarks
Foxmarks is now Xmarks! Install it on FF and IE.
Firebug... If you dont know about this little awesome thing, I have just 1 word for you: n00b! :P
BTW, check out Firebug Lite! It's a JS that makes a temporary firebug even in Safari and IE.

5) Photoshop
Do I need to write anything??

6) Dreamweaver
I dont use design view anymore, still the file listings... Drag-and-point linking(I am not sure that's the right term) and autocomplete are really very helpful.

7)XAMPP & Filezilla
For all the PHP and Ajax in your comp, xampp is compulsory.
+ Filezilla for uploading them to homepages and other servers.

8) Auslogics Disc Defrag

Colorful and I never had a problem with this one.

9)PDF995
This is good only if you dont want a heavier and much costlier Acrobat Professional.

10) Inkscape
Inkscape's not compulsory but it has a very easy but beautiful tool: The calligraphy tool + People say that it's a strong competition to Illustrator. I just found this example.

Did I miss anything? Leave a comment :)

Monday, May 4, 2009

Tweet!

So many IITians suddenly joined twitter... I am not sure whether it's the boredom of summer holidays or awesomeness of Twitter. But whatever be the case, it's good for information interchange. If you are not on twitter, join it. Believe me, it's good.
The best way to use twitter is to tell people what are you up to... surfing web pages, reading books, just chilling with friends or learning awesome stuff from this blog(oops!) you must tweet about it! (The last one's good for me)
Now thinking from a web master's point of view, we all would be really happy if someone tweets about our page/data. But we can't expect a reader to open a new tab and type in "twitter"... then press "Ctrl-Enter" and then type in your URL and then update his/her status. Yeah! they are lazy!
So what we do is... we add a little button on our blogs/webpages:

here is the code:

<a expr:href='&quot;http://twitter.com/home?status= is Reading &quot; + data:post.title + &quot; @ &quot; + data:post.url' style='float:right; padding-right:40px' target="_new" title='Tweet it on Twitter'><img src='http://sites.google.com/site/stupidlymonked/files/tweet.png'/></a>

Will give this result:


On clicking the link it will take you to your twitter page with appropriate status... :)
--------------------------------------------
Aah I forgot to add something very important... The data:post.title and data:post.url will not get parsed in pst. Just like in this case. Actually u have to add this button in the actual template.
Go to Dashboard >> Layout >> Edit HTML >>Expanded Widget View
and Find an appropriate place inside post area... :)


P.S: Bird Image's from Smashing Magazine + The Image's a PNG and so IE6 sucks!

Oh Fuck!


T-Shirt design?? May be ;)

Sunday, May 3, 2009

Best Comment

//
// Dear maintainer:
//
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
//
// total_hours_wasted_here = 16
//

For more comments like the one above visit this site

JSGraph2

Functionality almost same as JSGraph1... Just that the code is cent percent independent and original and creates a beautiful line graph on a canvas element.

DEMO

JSGraph1

It's a JS that creates a bar graph from an HTML table. Took a little help from JQuery Package.

DEMO

Titlator

OK! This javascript is funny. The first effect can still be used on serious titles but the rest are funny!

Check it out here: DEMO

Panorama

I have already mentioned this like a dozen times before... I love coding and web. Luckily, Javascript is one scripting language which is very similar to C++ (Hence Intutive) and easy to code at the same time.

Using background-position and background-repeat-x i created this small JS that creates a panorama. Image is just one tile...

Have a Look

Colorful Mosaic

Remember the golden days of Doordarshan!

This one's for a channel that entertained our country for years!

Colorful Mosaic - A Retro Wallpaper to celebrate Doordarshan
Colorful Mosaic - A Retro Wallpaper to celebrate Doordarshan

Grey Matter

When the night is dark and the wind is cold and strong...

When it's 4:30 AM in the night and there is no LAN

You are left with no choice but to make web templates :D

Here is a dark one... the GREY MATTER

DEMO | DOWNLOAD

In Noah's Boat

I designed this for my CS 296 project.

Uses an illustration Smashing Magazine gave away to be used as an
image.

Use it if you like.

DEMO | DOWNLOAD

Stupidly Named

I guess not... These are some of the most 'amazingly' named computer languages...
  • brainfuck : An esoteric programming language meant to tease programmers
  • Chef : Where programs look like recepies
  • Chuck : It's used for creating sound and music
  • Curry : This one's for logic and functional programming
  • Cyclone : There is no Katrina though...
  • Euphoria : Suspected to be backronym of End-User Programming with Hierarchical Objects for Robust Interpreted Applications
  • Fortress: Intended to be successor of Fortran.
  • Groovy : Alternative to Java
  • Lingo : actually many languages used that name
  • LOLCODE : Another esoteric programming language like brainfuck
  • Lucid : A dataflow language.
  • Moby : No, not moby dick...
  • Pizza : Superset of Java
  • Water : for prototyping of XML apps

L337

Awesomeness???