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 now = new Date(); | |
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); | |
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December'); | |
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate(); | |
function fourdigits(number) { | |
return (number < 1000) ? number + 1900 : 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
function toDoubleDigits(digits) { | |
return (digits[1]?digits:"0"+digits[0]); | |
} |
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 stopwatch = Stopwatch.StartNew(); | |
for (int i = 1; i < 1000000000; i++) | |
{ | |
// run method here | |
} | |
stopwatch.Stop(); | |
Console.writeline("Elapsed time: {0}", stopwatch.Elapsed); |
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 pageId = 1; | |
var pageRef = new PageReference(pageId ); | |
var page = DataFactory.Instance.GetPage(pageRef) as PageType; |
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
using System; | |
using System.Collections.Generic; | |
using System.Collections.Specialized; | |
using System.Globalization; | |
using System.IO; | |
using System.Text.RegularExpressions; | |
using System.Web; | |
namespace uBlogsy.Common.Extensions | |
{ |
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
$('input#expectedIncome').keypress(function() { | |
var e = window.event || e; | |
var keyUnicode = e.charCode || e.keyCode; | |
if (e !== undefined) { | |
switch (keyUnicode) { | |
case 13: break; // Enter | |
case 16: break; // Shift | |
case 17: break; // Ctrl | |
case 18: break; // Alt | |
case 27: this.value = ''; break; // Esc: clear entry |
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
<script type="text/javascript"> | |
$(function () { | |
// Code here | |
}); | |
</script> |
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 lang="en"> | |
<head> | |
<title>Basic HTML Page</title> | |
<meta name="description" content="My Basic HTML page"> | |
<meta name="author" content="Chris Randle"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta charset="utf-8"> |
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
HtmlDocument doc = new HtmlDocument(); | |
doc.LoadHtml(html); | |
string s = doc.DocumentNode.SelectSingleNode("//body").InnerText; |
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 validateEmail(email) { | |
var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; | |
return re.test(email); | |
} |