Skip to content

Instantly share code, notes, and snippets.

View creativeaura's full-sized avatar
🌴
On vacation

Gaurav Jassal creativeaura

🌴
On vacation
View GitHub Profile
@creativeaura
creativeaura / define_rjs.js
Created March 7, 2012 12:07
Define RequireJs Module
// Use this as a quick template for future modules
define([
'jquery',
'underscore',
'backbone'
], function($, _, Backbone){
return {};
});
@creativeaura
creativeaura / isfloat.js
Created March 9, 2012 09:01
JavaScript isFloat and isInteger
function isFloat(n){
return n === +n && n !== (n|0);
}
function isInteger(n){
return n === +n && n === (n|0);
}
@creativeaura
creativeaura / webkit-border-gradients.css
Created April 12, 2012 09:20
webkit-border gradient
div {
width:200px;
height:225px;
background:#DFDFDF;
border-style:solid;
border-width:10px;
-webkit-border-image: -webkit-linear-gradient(top, rgba(255,255,255,1) 10%,rgba(41,184,229,1) 100%) 1 100% 1 1 stretch stretch;
}
@creativeaura
creativeaura / jq_plugin.js
Created April 30, 2012 08:01
jQuery Plugin Template
// jQuery Plugin Boilerplate
// A boilerplate for jumpstarting jQuery plugins development
;(function($) {
$.pluginName = function(el, options) {
var defaults = {
propertyName: 'value',
onSomeEvent: function() {}
@creativeaura
creativeaura / server.bat
Created July 12, 2012 14:33
Run Python server from any folder on windows
@ECHO OFF
CLS
IF [%1]==[] (
C:\Python27\python.exe -m SimpleHTTPServer
) else (
C:\Python27\python.exe -m SimpleHTTPServer %1
)
@creativeaura
creativeaura / html.html
Created September 18, 2012 08:27
HTML Data
data:text/html,<input name="name">
@creativeaura
creativeaura / quiz.js
Created October 9, 2012 10:11
Javascript Quiz
var x = '' + 0/0, y = typeof true; (y[0] + x[1] + x + x[1]).toLowerCase()
@creativeaura
creativeaura / linkify.js
Created November 6, 2012 14:01 — forked from briancray/linkify.js
Linkify Twitter API entities
/*
Compliant with Twitter's Developer Display Requirements:
https://dev.twitter.com/terms/display-requirements
*/
var linkify_result = function (tweet /* tweet object from the results array */) {
var subs = [],
last_offset = 0,
new_tweet = '',
entity,
replace = {
@creativeaura
creativeaura / jquery-template.js
Created November 6, 2012 14:02
jQuery Plugin Template
(function($){
$.yourPluginName = function(el, radius, options){
// To avoid scope issues, use 'base' instead of 'this'
// to reference this class from internal events and functions.
var base = this;
// Access to jQuery and DOM versions of element
base.$el = $(el);
base.el = el;
@creativeaura
creativeaura / setting.json
Created November 9, 2012 14:26
Sublime setting file
{
"color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme",
"font_size": 10.0,
"ignored_packages":
[
"Vintage",
"jlegewie-SublimePeek-aaaaee6",
"Phoenix-Theme",
"zencoding",
"BracketHighlighter"