This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Track = Backbone.Model.extend(), | |
TrackList = Backbone.Collection.extend({ | |
model: Track | |
}), | |
Album = Backbone.RelationalModel.extend({ | |
relations: { | |
trackList: TrackList | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env node | |
// OpenShift sample Node application | |
var winston = require('winston'); | |
var MongoDB = require('winston-mongodb').MongoDB; | |
winston.add(MongoDB, { | |
db: process.env.OPENSHIFT_APP_NAME | |
, host: process.env.OPENSHIFT_NOSQL_DB_HOST | |
, port: parseInt(process.env.OPENSHIFT_NOSQL_DB_PORT, 10) |
OlderNewer