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
[HtmlCompletionProvider(CompletionTypes.Values, "*", "class")] | |
[ContentType("htmlx")] | |
class GlyphClassCompletionListProvider : BaseClassCompletionProvider | |
{ | |
private static bool _glyphsLoaded; | |
public override string CompletionType | |
{ | |
get { return CompletionTypes.Values; } | |
} |
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
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] | |
[ProvideAutoLoad(UIContextGuids80.SolutionExists, PackageAutoLoadFlags.BackgroundLoad)] | |
public sealed class ExamplePackage : Package | |
{ | |
protected override async task Initialize() | |
{ | |
// Load necessary stuff for MEF Component here | |
base.Initialize(); | |
} | |
} |
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
[HtmlCompletionProvider(CompletionTypes.Values,"*", "class")] | |
[ContentType(HtmlContentTypeDefinition.HtmlContentType)] | |
class FooBarClassCompletion : BaseCompletionProvider | |
{ | |
private static List<string> _classes = new List<string>() | |
{ | |
"foo", | |
"bar", | |
}; |
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
public class AuditAttribute : ActionFilterAttribute | |
{ | |
public override void OnActionExecuting(ActionExecutingContext filterContext) | |
{ | |
//Stores the Request in an Accessible object | |
var request = filterContext.HttpContext.Request; | |
//Generate an audit | |
Audit audit = new Audit() | |
{ | |
//Your Audit Identifier |
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
public static class IQueryableExtensions | |
{ | |
private static readonly TypeInfo QueryCompilerTypeInfo = typeof(QueryCompiler).GetTypeInfo(); | |
private static readonly FieldInfo QueryCompilerField = typeof(EntityQueryProvider).GetTypeInfo().DeclaredFields.First(x => x.Name == "_queryCompiler"); | |
private static readonly PropertyInfo NodeTypeProviderField = QueryCompilerTypeInfo.DeclaredProperties.Single(x => x.Name == "NodeTypeProvider"); | |
private static readonly MethodInfo CreateQueryParserMethod = QueryCompilerTypeInfo.DeclaredMethods.First(x => x.Name == "CreateQueryParser"); |
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
// This indicates that this function is going to extend from jQuery | |
// and it accepts a jQuery selector as a parameter | |
$.fn.randomize = function(selector){ | |
// This will attempt to find a selector if one exists (this.find(selector)) or it will use the current object (this) | |
// And it will target the parent of whatever is selected | |
(selector ? this.find(selector) : this).parent().each(function(){ | |
// It will then target all of the children below this selector and sort each of them based off of a randomly generated value | |
// from Math.random(). This will apply the order to the elements | |
$(this).children(selector).sort(function(){ | |
return Math.random() - 0.5; |
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
// This accepts a string numbuer and will increment the numeric part by 1 | |
function stringNumber(str){ | |
// This will use a regular expression to match the last series of numbers that appear in | |
// your string (/\d+$/) and it will map that value to a function that will replace it with | |
// the result of the actual number it contains (Number(n)), which will do something like | |
// mapping "999" to 999 and then incrementing it by 1 (Number(n) + 1) | |
return str.replace(/\d+$/, function(n) { return Number(n) + 1; }); | |
} | |
function stringNumber(str){ |
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 Validation() { | |
var username = $("#username").val(); | |
var password = $("#password").val(); | |
var password2 = $("#password2").val(); | |
var user_textLength = username.trim().length; | |
var pw_textLength = password.trim().length; | |
var x = email; | |
var atpos = x.indexOf("@"); | |
var dotpos = x.lastIndexOf("."); | |
if (user_textLength <= 7) { |
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
' Build a Connection to use | |
Using connection = New OleDbConnection("{your-connection-string}") | |
' Open your connection | |
connection.Open() | |
' Build your query (using parameters) | |
Dim query = "UPDATE tb_kamar SET no_ktp = NULL WHERE no_kamar = ?" | |
' Build a command to execute | |
Using command = New OleDbCommand(query, connection) | |
' Add your parameters | |
command.Parameters.AddWithValue("@sed", cbnokam.Text) |
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
<button class='Remove' data-id='42'>Click Me!</button> | |
<script src="https://code.jquery.com/jquery-2.1.4.js"></script> | |
<script> | |
$(function(){ | |
$('.Remove').click(function () { | |
debugger; | |
var myId = $(this).data('id'); | |
$.ajax({ | |
url: '@Url.Action("Remove", "ReadingNow")?Book_id=' + myId, | |
success: function (response) { |