Skip to content

Instantly share code, notes, and snippets.

View vmandic's full-sized avatar
🤠
chillin'

Vedran Mandić vmandic

🤠
chillin'
View GitHub Profile
@vmandic
vmandic / create-aspnet-core-identity-schema.sql
Created December 29, 2019 14:46 — forked from akatakritos/create-aspnet-core-identity-schema.sql
Script to create the ASPNET core Identity tables
USE [HobbyDB]
GO
/****** Object: Table [dbo].[AspNetRoleClaims] Script Date: 6/4/2018 10:18:03 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[AspNetRoleClaims]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[AspNetRoleClaims](
@vmandic
vmandic / Documentation.cs
Created July 3, 2019 20:32 — forked from hlaueriksson/Examples.cs
PuppeteerSharp Basic Tests
using System;
using System.Threading.Tasks;
using Xunit;
namespace PuppeteerSharp.Extensions.Tests
{
public class Documentation
{
[Fact]
public async Task download_Chromium()
@vmandic
vmandic / AsyncDisposal.cs
Created April 10, 2019 20:04 — forked from binki/AsyncDisposal.cs
Async disposal
using System;
using System.Threading.Tasks;
class Program
{
static void Main() => new Program().Run().Wait();
async Task Run()
{
Console.WriteLine("Before Using");
await Async.Using(new Test(), t =>
Dictionary<string, string> options = new Dictionary<string, string>()
{
{"$select" , "ID" },
{"$expand" , "ProductDetail" },
{"$filter" , "Categories/any(d:d/ID gt 1)" },
{"$orderby" , "ID desc" },
{"$top" , "1" },
{"$count" , "true" },
{"$search" , "tom" },
};
@vmandic
vmandic / ODataEntityFrameworkModelBuilder.cs
Last active February 2, 2023 14:00 — forked from dariusclay/ODataEntityFrameworkModelBuilder.cs
How to build OData IEdmModel from .NET Framework Entity Framework 6 model
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Data.Entity;
using System.Data.Entity.Core.EntityClient;
using System.Data.Entity.Infrastructure;
using System.Diagnostics;
@vmandic
vmandic / git-commit-log-stats.md
Created February 13, 2018 14:11 — forked from eyecatchup/git-commit-log-stats.md
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@vmandic
vmandic / GoogleAnalyticsApi.cs
Created September 29, 2017 13:49 — forked from 0liver/GoogleAnalyticsApi.cs
C# wrapper around the Google Analytics Measurement Protocol API
/* based on the docs at: https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide */
/*
* LICENSE: MIT
* AUTOHR: oliver@teamaton.com
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
reg add "HKLM\Software\Microsoft\Fusion" /v EnableLog /t REG_DWORD /d 0 /f
@vmandic
vmandic / DeliminatorSeparatedPropertyNamesContractResolver.cs
Created January 6, 2017 20:24 — forked from roryf/DeliminatorSeparatedPropertyNamesContractResolver.cs
Snake case (underscore separated) property name resolver for Newtonsoft.Json library
public class DeliminatorSeparatedPropertyNamesContractResolver : DefaultContractResolver
{
private readonly string _separator;
protected DeliminatorSeparatedPropertyNamesContractResolver(char separator) : base(true)
{
_separator = separator.ToString();
}
protected override string ResolvePropertyName(string propertyName)
@vmandic
vmandic / ko-chosen.js
Created October 5, 2016 14:04 — forked from isDipesh/ko-chosen.js
Collection of Knockout.js custom bindings.
//http://stackoverflow.com/questions/13210663/how-to-order-knockout-bindings
ko.bindingHandlers.chosen = {
init: function(element, valueAccessor, allBindingsAccessor, viewModel) {
var allBindings = allBindingsAccessor();
var options = {default: 'Select one...'};
$.extend(options, allBindings.chosen)
$(element).attr('data-placeholder', options.default);