Skip to content

Instantly share code, notes, and snippets.

@idosela
idosela / http-response-interceptor.js
Last active February 25, 2024 12:51
Sample code for ng-conf 2014
angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) {
$httpProvider.responseInterceptors.push([
'$q', '$templateCache', 'activeProfile',
function($q, $templateCache, activeProfile) {
// Keep track which HTML templates have already been modified.
var modifiedTemplates = {};
// Tests if there are any keep/omit attributes.
var HAS_FLAGS_EXP = /data-(keep|omit)/;
@jphastings
jphastings / 1.readme.md
Created September 22, 2010 22:41
Got bored, wrote a Yaml parser (ish) in javascript.

Usage

console.log(YAML.eval("Yaml!"))

New features

  • Now does comments (& --- lines)
  • Deals with booleans (yes, no, true, false)
  • Handles multi-line strings (both types!)
  • Single-line hashes now supported