This file contains hidden or 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 sel = window.getSelection(); | |
var range = document.createRange(); | |
range.setStart( sel.anchorNode, sel.anchorOffset ); | |
This file contains hidden or 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
Array.max = function( array ){ | |
return Math.max.apply( Math, array ); | |
}; | |
Array.min = function( array ){ | |
return Math.min.apply( Math, array ); | |
}; |
This file contains hidden or 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
cat /etc/passwd |
This file contains hidden or 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
$('selector').twitter('search terms'); |
This file contains hidden or 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> | |
<title>Twitter Search Plugin</title> | |
<script src="http://code.jquery.com/jquery.js"></script> | |
<script src="jquery.twitter.js"></script> | |
<style type="text/css"> | |
.twitter-posts li {margin-bottom: 10px; font-size: 12px; clear: both; list-style-type:none;} | |
.twitter-posts li img {float:left; width: 48px; margin:0px 10px 10px 0px;border:1px solid #c2c2c2; -moz-box-shadow: 0px 0px 4px #c2c2c2; -webkit-box-shadow: 0px 0px 4px #c2c2c2; box-shadow: 0px 0px 4px #c2c2c2;} | |
.twitter-posts li a {text-decoration:none; color: #009;} |
This file contains hidden or 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
// src/application.js | |
// Define the application namespace in global scope and module handler | |
var namespace = { | |
// Create this closure to contain the cached modules | |
module: function() { | |
// Internal module cache. | |
var _modules = {}; | |
// Create a new module reference scaffold or load an | |
// existing module. |
This file contains hidden or 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 chat = { | |
// Create this closure to contain the cached modules | |
module: function() { | |
// Internal module cache. | |
var modules = {}; | |
// Create a new module reference scaffold or load an | |
// existing module. | |
return function(name) { | |
// If this module has already been created, return it. |
This file contains hidden or 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
// Define whatever global space vars you might need. | |
var mbta = { | |
// application configuration parameters | |
app : { | |
server : "http://backbonetraining.bocoup.com:8000" | |
}, | |
// application data | |
data : { | |
// station collection | |
lines : null |
This file contains hidden or 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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>Example</title> | |
<link rel="stylesheet" href="/assets/css/main.css"> | |
</head> | |
<body> |
This file contains hidden or 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
// Create base tweet model and tweets collection. | |
var Tweet = Backbone.Model.extend({}); | |
var Tweets = Backbone.Collection.extend({ | |
model : Tweet, | |
initialize: function(options) { | |
this.query = options.query | |
}, | |
url: function() { | |
return "http://search.twitter.com/search.json?q=" |
OlderNewer