This file contains hidden or 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 check_nric(nric_number) { | |
var nric_first = ''; | |
var nric_last = ''; | |
var nric_code = -1; | |
var nric_checksum = -1; | |
var mod_calculate = -1; | |
var checksum_boolean = false; |
This file contains hidden or 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
navigator.sayswho= (function(){ | |
var ua= navigator.userAgent, tem, | |
M= ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; | |
if(/trident/i.test(M[1])){ | |
tem= /\brv[ :]+(\d+)/g.exec(ua) || []; | |
return 'IE '+(tem[1] || ''); | |
} | |
if(M[1]=== 'Chrome'){ | |
tem= ua.match(/\b(OPR|Edge)\/(\d+)/); | |
if(tem!= null) return tem.slice(1).join(' ').replace('OPR', 'Opera'); |
This file contains hidden or 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
DateTimeOffset.TryParseExact("2300", "HHmm", CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTimeOffset startTime); | |
DateTimeOffset.TryParseExact("2340", "HHmm", CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTimeOffset endTime); | |
var result = DateTime.Now.TimeOfDay > startTime.TimeOfDay; | |
var compareTime = TimeSpan.Compare(startTime.TimeOfDay, endTime.TimeOfDay); | |
if(compareTime == 1) | |
{ | |
// EndTime is next day | |
result &= DateTime.Now.TimeOfDay > endTime.TimeOfDay; |
This file contains hidden or 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 Ninject.Modules; | |
using SitefinityWebApp.Tasks; | |
namespace SitefinityWebApp.App_Start | |
{ | |
public class DependencyMapping : NinjectModule | |
{ | |
public override void Load() | |
{ | |
this.Bind<IGenericTask>().To<GenericTask>(); |
This file contains hidden or 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
public static void Main(string[] args) | |
{ | |
var str = new string[] { "2", "1Z", "61", "67", "75", "167", "169", "171", "172", "176", "178", "180", "184", "187", "188", "188E", "188R", "190", "300", "301", "302", "307", "653", "656", "657", "700", "700A", "825", "853", "854", "854E", "855", "856", "857", "858", "859", "859A", "859B", "868", "882", "883", "900", "900A", "901", "902", "903", "903M", "904", "911", "912", "912M", "913", "920", "922", "925", "925C", "926", "927", "950", "951E", "960", "961", "961C", "962", "963", "963E", "963R", "964", "965", "966", "969", "970", "971E", "972", "973", "975", "975B", "979", "980", "981", "982E", "983", "985", "BPS1", "NR1", "NR2", "NR3", "NR5", "NR6", "NR7", "NR8", "110", "944", "991", "169A", "169B", "190A", "307E", "307A", "912A", "913M", "912B", "913E", "3A", "1", "1Y", "67E", "75C" }; | |
Console.Write(string.Join(", ", str.ToList())); | |
Console.WriteLine(); | |
Console.WriteLine(); | |
var newStr = str.OrderBy(x => x, new AlphanumComparatorFast()); | |
C |
This file contains hidden or 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 <your_db> | |
GO | |
UPDATE [dbo].[sf_users] | |
SET [user_name] = 'admin' | |
,[salt] = null | |
,[password_format] = 0 | |
,[passwd] = 'Test123' | |
WHERE user_name = <your_reset_user_name> | |
GO |
This file contains hidden or 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 () { | |
//add the following snippet before the definition of the custom controller: | |
angular.module('designer').controller('SimpleCtrl', ['$scope', 'propertyService', function ($scope, propertyService) { | |
propertyService.get().then(function (data) { | |
if (data) { | |
$scope.properties = propertyService.toAssociativeArray(data.Items); | |
var leftModelJson = $scope.properties.LeftModelJson.PropertyValue; |
This file contains hidden or 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 SitefinityWebApp.Mvc.Models; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Linq; | |
using System.Web.Mvc; | |
using Telerik.Sitefinity.ContentLocations; | |
using Telerik.Sitefinity.Data; | |
using Telerik.Sitefinity.DynamicModules; | |
using Telerik.Sitefinity.DynamicModules.Builder.Model; | |
using Telerik.Sitefinity.DynamicModules.Model; |
This file contains hidden or 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
public interface IQueryService | |
{ | |
void CreateTable(string script); | |
void InsertRecord(string script); | |
IList<T> SelectRecord<T>(string script); | |
} |
This file contains hidden or 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
<style> | |
.sfPageContainer .tab-pane { | |
display: block !important | |
} | |
</style> | |
<ul class="nav nav-tabs" id="myTab" role="tablist"> | |
<li class="nav-item"> | |
<a class="nav-link active" data-sf-element="Tab-1" data-toggle="tab" href="#tab1Content" role="tab" aria-controls="tab1Content" aria-selected="true"> | |
<div class="sf_colsIn" data-sf-element="Tab-1-Title" data-placeholder-label="Tab 1 Title"></div> |
OlderNewer