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
/// <summary> | |
/// Check any property on dynamic data type whether id exists or not | |
/// </summary> | |
/// <param name="settings">your object</param> | |
/// <param name="name">key to search</param> | |
/// <returns>True or False</returns> | |
/// <example> | |
/// bool isExists = IsPropertyExists(Dictionary<string, dynamic>, string); | |
/// <example> | |
public bool IsPropertyExists(dynamic settings, string name) |
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
// db = Instance of Entities Object | |
public static void StoreLastSequence(int lastSequence, string prefix) | |
{ | |
applicationoption applicationoption = db.applicationoption.Where(m => m.CODE == "NOMOR_INVOICE").Single(); | |
applicationoption.VALUE = lastSequence.ToString(); | |
db.Entry(applicationoption).State = System.Data.EntityState.Modified; | |
db.SaveChanges(); | |
} |
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
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head runat="server"> | |
<title>Document Viewer</title> | |
</head> | |
<body style="overflow: hidden;"> | |
<div id="objviewer"> </div> | |
<script type="text/javascript"> | |
const b64toBlob = (b64Data, contentType = '', sliceSize = 512) => { | |
const byteCharacters = atob(b64Data); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<directoryBrowse enabled="false" /> | |
<rewrite> | |
<rules> | |
<rule name="wordpress" patternSyntax="Wildcard"> | |
<match url="*" /> | |
<conditions> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> |
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
// Copyright by Bo Norgaard, All rights reserved. | |
using System; | |
using System.Text; | |
using System.Collections; | |
namespace Misc.Helpers.IPNumbers | |
{ | |
/// <summary> |
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 System; | |
using System.Configuration; | |
using System.Web; | |
using System.Web.Http; | |
using System.Web.Http.Controllers; | |
namespace Miscellaneous.Attributes.Controller | |
{ | |
/// <summary> | |
/// Filter by IP address (ASP.NET Web API version) |
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 Misc.Helpers.IPNumbers; | |
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.Web; | |
using System.Web.Http; | |
using System.Web.Http.Controllers; | |
namespace Misc.WebApi.Filters | |
{ |
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
AddOutputFilterByType DEFLATE text/plain | |
AddOutputFilterByType DEFLATE text/html | |
AddOutputFilterByType DEFLATE text/xml | |
AddOutputFilterByType DEFLATE text/css | |
AddOutputFilterByType DEFLATE application/xml | |
AddOutputFilterByType DEFLATE application/xhtml+xml | |
AddOutputFilterByType DEFLATE application/rss+xml | |
AddOutputFilterByType DEFLATE application/javascript | |
AddOutputFilterByType DEFLATE application/x-javascript |
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
// 1. Use object.some | |
var index = -1; | |
items.some(function(el, i) { | |
if (el.OBJECT_NAME == "search") { | |
index = i; | |
return true; | |
} | |
}); | |
// 2. use underscore.js |
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
<IfModule mod_mime.c> | |
# Text | |
AddType text/css .css | |
AddType application/x-javascript .js | |
AddType text/html .html .htm | |
AddType text/richtext .rtf .rtx | |
AddType text/plain .txt | |
AddType text/xml .xml |