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
alert('test mercutio'); |
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 expect = chai.expect; | |
describe('services', function(){ | |
var goat, monkey, monkey2, Donkey, tiger1, tiger2, lion; | |
beforeEach(function(){ | |
//load the module | |
module('app'); | |
//configure providers |
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
<h1>Inner</h1> | |
<img src="http://www.21stcenturytiger.org/wp-content/blogs.dir/2/files/home-page/malayan_adrianotavano_zoomaimi2_2012.jpg"/> |
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
alert('ha!'); |
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
/* | |
How to use Angular inside a Backbone view. | |
*/ | |
var ViewWithAngular = Backbone.View.extend({ | |
render: function(container){ | |
var $injector = angular.injector(['ng', 'mason']); | |
$injector.invoke(function($rootScope, $compile){ | |
var elem = $compile('<h1 ng-controller="NestedCtrl">Backbone View with nested Angular. Message: {{message}}</h1>')($rootScope); |
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
<Response> | |
<Play>http://stark-eyrie-7115.herokuapp.com/cmm.mp3</Play> | |
</Response> |
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
/* Pattern for OOP in JavaScript */ | |
//TODO see if safe way to add inheritsFrom to Function | |
var should = require('should'); | |
function inherit(C, P){ | |
var F = function(){}; //intermediary function between Parent and Child | |
F.prototype = P.prototype; //link intermediary function to Parent | |
var funcs = C.prototype; //keep track of any existing functions on the Child prototype | |
C.prototype = new F(); //link child to intermediary function | |
for (var attrname in funcs) { |
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
Show hidden characters
{ | |
"caret_style": "wide", | |
"color_scheme": "Packages/Color Scheme - Default/GrandsonOfObsidian.tmTheme", | |
"font_face": "Source Code Pro light", | |
"font_size": 19.0, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], | |
"save_on_focus_lost": true, |
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 express = require('express'); | |
var connect = require('connect'); | |
var zlib = require('zlib'); | |
var fs = require('fs'); | |
var app = express(); | |
var compressOptions = { | |
filter: function(req, res) { | |
return /json|text|xml|javascript/.test(res.getHeader('Content-Type')) | |
} |
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 http = require('http'); | |
var fs = require('fs'); | |
var zlib = require('zlib'); | |
http.createServer(function (req, res) { | |
// var img = fs.readFileSync('./bird.jpg'); | |
var img = fs.createReadStream('./public/bird.jpg'); | |
// res.writeHead(200, {'Content-Type': 'image/jpeg'}); | |
res.writeHead(200, { 'content-encoding': 'gzip' }); |