Skip to content

Instantly share code, notes, and snippets.

View text box with an arrow
.widget-text {
background-color: #999590;
color: white;
margin: 10px 0 0 70px;
padding: 1px 20px;
position: relative;
.widget-text:before, .widget-text:after {
content: "";
View autocomplete
$.fn.showPostcodeAutoComplete = function (pcode) {
source: function (request, response) {
url: 'api/checkout/GetPostCodeList',
type: 'POST',
contentType: 'application/json; charset=utf-8',
data: JSON.stringify(pcode),
dataType: 'json',
View covert EpochTime to Datetime and covert Datetime to EpochTime
/// <summary>
/// Converts the given date value to epoch time.
/// </summary>
public static long ToEpochTime(this DateTime dateTime)
var date = dateTime.ToUniversalTime();
var ticks = date.Ticks - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).Ticks;
var ts = ticks / TimeSpan.TicksPerSecond;
return ts;
View cookie
View manipulate dropdown list and checkbox
***** Always select last one ,when add a new one, this list will select new one automatically *****
<label>Summary: </label>
<select (change)="filterForeCasts($event.value)">
<option *ngFor="let summary of summaries" [value]="summary" [selected]="summary == summaries[summaries.length-1]">
View update object in object array
shoppingCarts: ShoppingCart[] = [];
shoppingCart: ShoppingCart;, key) => {
if( =={
this.shoppingCarts[key] = this.shoppingCart;
View Model DataAnnotation test
public class OrganisationVM
public int Id { get; set; }
[MinLength(5, ErrorMessage = "Must be at least 5 characters long")]
public string Name { get; set; }
View userful tool
FileZilla, winscp -- FTP
progress telerik fiddler web debugger -- http
progress telerik justdecompile -- decompile dll file
snipping tool -- screenshot -- small ps
You can’t perform that action at this time.