Skip to content

Instantly share code, notes, and snippets.

Avatar

Fizer Khan (பைசர் கான்) fizerkhan

View GitHub Profile
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<div class="steps">
<a href="" class="step step1">1</a>
<div class="line line1"></div>
<a href="" class="step step2">2</a>
<div class="line line2"></div>
@renajohn
renajohn / dateFormatter.js
Created Oct 26, 2011
Handlebar date formatter helper
View dateFormatter.js
/**
* Date formatting helper.
*
* Date helper takes a SC.DateTime and return a formatted string based on the format
* parameter. If no format is given, it uses %c as default.
*
* @param format a format string
*/
Handlebars.registerHelper('date', function(path, block) {
if (path) {
@fizerkhan
fizerkhan / gist:2364466
Created Apr 12, 2012
I'd like to double click this td element and have #heythere toggle too
View gist:2364466
HTML
----
<table class="table table-striped">
<tbody>
<tr class="diary_hour"><!-- Hour Row Start -->
<td class="span1" data-toggle="collapse" data-target="#heythere" title="Got a question? Drop us a line.">
<h4>Click Here</h4>
</td>
<td class="test"> <!-- I'd like to double click this td element and have #heythere toggle too -->
@diurnalist
diurnalist / gist:2364707
Created Apr 12, 2012
Lightweight Relation Modeling with Backbone (6)
View gist:2364707
var Track = Backbone.Model.extend(),
TrackList = Backbone.Collection.extend({
model: Track
}),
Album = Backbone.RelationalModel.extend({
relations: {
trackList: TrackList
}
});
@ruturajv
ruturajv / beacon.js
Created Apr 25, 2012
node.js web beacon (web bug) serving
View beacon.js
http = require('http');
url = require('url');
http.createServer(function(req, res){
var requestURL = url.parse(req.url, true)['pathname'];
if (requestURL == '/log.gif') {
var imgHex = '47494638396101000100800000dbdfef00000021f90401000000002c00000000010001000002024401003b';
var imgBinary = new Buffer(imgHex, 'hex');
res.writeHead(200, {'Content-Type': 'image/gif' });
@danbronsema
danbronsema / responsivemenu.css
Created May 3, 2012
CSS - Responsive Menu in Bootstrap
View responsivemenu.css
@media (max-width: 979px) {
body {
padding-top: 0;
}
.navbar-fixed-top {
position: static;
margin-bottom: 18px;
}
.navbar-fixed-top .navbar-inner {
padding: 5px;
@midnightcodr
midnightcodr / sample_contact_us_form_bootstrap_styling.html
Created May 21, 2012
A sample contact form using twitter bootstrap styling
View sample_contact_us_form_bootstrap_styling.html
<form class="well span8">
<div class="row">
<div class="span3">
<label>First Name</label>
<input type="text" class="span3" placeholder="Your First Name">
<label>Last Name</label>
<input type="text" class="span3" placeholder="Your Last Name">
<label>Email Address</label>
<div class="input-prepend">
<span class="add-on"><i class="icon-envelope"></i></span><input type="text" id="inputIcon" class="span2" style="width:233px" placeholder="Your email address">
@otanistudio
otanistudio / chat-frontend.js
Created Jun 2, 2012 — forked from martinsik/chat-frontend.js
Node.js chat server, with the frontend changed to use BackboneJS
View chat-frontend.js
/*global $, Backbone, window, console, WebSocket, _ */
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var $content = $('#content')
, $input = $('#input')
, $status = $('#status')
// my color assigned by the server
@OpenGrid
OpenGrid / twitter-bootstrap-forms-responsive.css
Created Jul 24, 2012
Twitter Bootstrap form-horizontal css for form for two column layout
View twitter-bootstrap-forms-responsive.css
@media (max-width: 980px) {
.form-horizontal .control-group > label {
float: none;
width: auto;
padding-top: 0;
text-align: left;
}
.form-horizontal .controls {
margin-left: 0;
}
@jonotron
jonotron / backbone.dualstorage.relational.js
Created Jul 24, 2012
Recursively create UUIDs on Backbone.RelationalModels when saving via Backbone.Dualstorage
View backbone.dualstorage.relational.js
var _create = window.Store.prototype.create; // reference to original create
/**
* Create a slightly more compliant UUID generator
* credit: http://stackoverflow.com/posts/2117523/revisions
*
* @returns generated UUID
*/
var generateId = window.Store.prototype.generateId = function() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {