Skip to content

Instantly share code, notes, and snippets.

View msrafi's full-sized avatar

Rafi msrafi

  • Jersey City
View GitHub Profile
@msrafi
msrafi / jquery.ba-tinypubsub.js
Created October 25, 2012 18:18 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
@msrafi
msrafi / pubsub-demo.js
Created November 6, 2012 16:28 — forked from rmurphey/pubsub-demo.js
JS for pubsub screencast
/* traditional way */
(function($) {
$(document).ready(function() {
$('#searchForm').submit(function(e) {
var term = $.trim($(this).find('input[name="q"]').val());
if (!term) { return; }
$.getJSON(
@msrafi
msrafi / LICENSE.txt
Created November 6, 2012 17:18 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@msrafi
msrafi / LICENSE.txt
Created November 6, 2012 17:30 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@msrafi
msrafi / LICENSE.txt
Created November 6, 2012 22:49 — forked from tkissing/LICENSE.txt
mstc - mustache style templating compressed to (less than) 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Timo Kissing http://kissing.name
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@msrafi
msrafi / LICENSE.txt
Created November 6, 2012 23:03 — forked from sdepold/LICENSE.txt
Javascript: 140byt.es -- addObserverMethods
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Sascha Depold http://depold.com
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@msrafi
msrafi / LICENSE.txt
Created November 6, 2012 23:05 — forked from jed/LICENSE.txt
jQuery: pubsub
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@msrafi
msrafi / mobile-meta-links.html
Created February 28, 2013 03:51
Mobile: Meta Links
@msrafi
msrafi / jQuery: Scroll at bottom
Created March 8, 2013 17:00
jQuery: Scroll at bottom
$(window).scroll(function () {
if ($(window).scrollTop() == ( $(document).height() - $(window).height())) {
console.log("working");
}
});
@msrafi
msrafi / Javascript-snippets.js
Created March 11, 2013 16:56
Jquery: snippets
//JS Snippets
// Gets the browser prefix
var browserPrefix;
navigator.sayswho= (function(){
var N = navigator.appName, ua = navigator.userAgent, tem;
var M = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
if(M && (tem = ua.match(/version\/([\.\d]+)/i))!= null) M[2] = tem[1];
M = M? [M[1], M[2]]: [N, navigator.appVersion,'-?'];
M = M[0];