Skip to content

Instantly share code, notes, and snippets.

View vmandic's full-sized avatar
🤠
chillin'

Vedran Mandić vmandic

🤠
chillin'
View GitHub Profile
import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
@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);
@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)
reg add "HKLM\Software\Microsoft\Fusion" /v EnableLog /t REG_DWORD /d 0 /f
@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;
@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 / 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;
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 / 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 =>
@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()