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 ng-app='app'> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js"></script> | |
</head> | |
<body ng-controller="defaultController"> | |
</body> | |
<script> | |
var app = angular.module('app', []); |
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 commentContentsRegex = /\/\*!?(?:\@preserve)?[ \t]*(?:\r\n|\n)([\s\S]*?)(?:\r\n|\n)\s*\*\//; | |
function multilinestring(fn){ | |
return commentContentsRegex.exec(fn.toString())[1]; | |
} | |
console.log(multilinestring(function (){ | |
/* | |
something is up |
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
"use strict"; | |
var maybe = function(expr){ | |
var value; | |
try{ | |
value = (typeof expr === 'function') ? expr() : expr; | |
} | |
catch(e){ | |
value = null; | |
} |
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 ng-app="app"> | |
<head> | |
</head> | |
<body> | |
<div ng-controller="OneController" ng-controller="ThreeController"> | |
<list list-onclick="doWork"></list> | |
</div> | |
<div ng-controller="TwoController"> |
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
function maybe(value){ | |
var unit = { | |
bind: function(successHandler, failureHandler){ | |
if(unit.isEmpty){ | |
if(failureHandler) { | |
try{ | |
failureHandler(unit.message); | |
} | |
catch(e){ | |
unit.error = e; |
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://enable-cors.org/server_expressjs.html | |
var allowCrossDomain = function(req, res, next) { | |
if(req.headers.host && req.headers.host === "127.0.0.1:4271"){ | |
next(); | |
} | |
else{ | |
res.cookie('mycookie', 'bar', { domain: '.kpoppin.net' }); | |
res.header('Access-Control-Allow-Credentials', true); | |
res.header("Access-Control-Allow-Origin", req.headers.origin); |
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
function MyError(message){ | |
this.message = message; | |
} | |
MyError.prototype = new Error(); | |
try{ | |
throw new MyError("message"); | |
} | |
catch(e){ |
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
function math(value){ | |
var unit = { | |
add: function(){ | |
var args = Array.prototype.slice.call(arguments); | |
var sum = args.reduceRight(function(previousValue, currentValue, index, array) { | |
return previousValue + currentValue; | |
}); | |
return math(sum + value); | |
}, | |
multiply: function(number){ |
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
* { background-color: rgba(255,0,0,.2); } | |
* * { background-color: rgba(0,255,0,.2); } | |
* * * { background-color: rgba(0,0,255,.2); } | |
* * * * { background-color: rgba(255,0,255,.2); } | |
* * * * * { background-color: rgba(0,255,255,.2); } | |
* * * * * * { background-color: rgba(255,255,0,.2); } |
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
background-position: calc(100% - 50px) calc(100% - 20px); |