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> | |
<title>Rich Text Editor</title> | |
<script type="text/javascript"> | |
var oDoc, sDefTxt; | |
function initDoc() { | |
oDoc = document.getElementById("textBox"); | |
sDefTxt = oDoc.innerHTML; |
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="test" > | |
<head> | |
<meta charset="utf-8"> | |
<title>AngularJS test</title> | |
<script>document.write('<base href="' + document.location + '" />');</script> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular-route.js"></script> | |
</head> | |
<body> |
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
// resharper has a refactoring for this but I use it in LinqPad. This works for very simple cases to save me some typing | |
foreach(var prop in anon.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public)) | |
{ | |
Console.WriteLine("\tpublic {0} {1};", prop.PropertyType, prop.Name); | |
} |
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
if (jerry) { alert("already added ngHelpers"); } // | |
var jerry = (function(){ | |
var count = 0; | |
var unregisterDigestWatch = function() {}; // init empty | |
function registerDigestWatch(scope) { | |
scope = scope || angular.element(document).scope(); | |
unregisterDigestWatch = scope.$watch(function() { | |
var c = count++; |
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 getWatchers(root) { | |
root = angular.element(root || document.documentElement); | |
var watcherCount = 0; | |
function getElemWatchers(element) { | |
var isolateWatchers = getWatchersFromScope(element.data().$isolateScope); | |
var scopeWatchers = getWatchersFromScope(element.data().$scope); | |
var watchers = scopeWatchers.concat(isolateWatchers); | |
angular.forEach(element.children(), function (childElement) { | |
watchers = watchers.concat(getElemWatchers(angular.element(childElement))); |
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
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ | |
/* |
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
void Main() | |
{ | |
var cultures = System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.AllCultures); | |
foreach(var cultureInfo in cultures) | |
{ | |
Thread.CurrentThread.CurrentCulture = cultureInfo; | |
var datetime = new DateTime(2000, 1, 1, 23, 0, 0); | |
var formatted = datetime.ToString("t"); | |
var is24Hrs = formatted.Contains("23"); | |
//Assert.AreEqual(is24Hrs, cultureInfo.Is24Hrs()); |