Skip to content

Instantly share code, notes, and snippets.

View vmandic's full-sized avatar
🤠
chillin'

Vedran Mandić vmandic

🤠
chillin'
View GitHub Profile
@roryf
roryf / DeliminatorSeparatedPropertyNamesContractResolver.cs
Created June 23, 2011 13:09
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)
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active July 7, 2024 19:32
A badass list of frontend development resources I collected over time.
@isDipesh
isDipesh / ko-chosen.js
Last active January 11, 2019 23:42
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);
@shsteimer
shsteimer / gist:7257245
Created October 31, 2013 21:10
Tip to delete tags by pattern
#delete all the remote tags with the pattern your looking for, ie. DEV-
git tag | grep <pattern> | xargs -n 1 -i% git push origin :refs/tags/%
#delete all your local tags
git tag | xargs -n 1 -i% git tag -d %
#fetch the remote tags which still remain
git fetch
@0liver
0liver / GoogleAnalyticsApi.cs
Last active March 24, 2023 09:34
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;
@ODataTeam
ODataTeam / ODataQueryOptionParserParsingQueryOptions.cs
Last active March 3, 2018 11:57
Parsing query options using query option parser
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" },
};
@jpluimers
jpluimers / Disable-Fusion-Log-.NET-Assembly-Binding-Logging.bat
Created November 28, 2014 07:27
.NET enable and disable Fusion log
reg add "HKLM\Software\Microsoft\Fusion" /v EnableLog /t REG_DWORD /d 0 /f
@FeodorFitsner
FeodorFitsner / build.cmd
Created July 5, 2015 20:33
Taking version from AssemblyInfo.cs and using it with AppVeyor
rem This is how we get version in environment variable
for /f %%i in ('PowerShell -File get-version.ps1') do set my_version=%%i
@JonCole
JonCole / ThreadPool.md
Last active March 6, 2024 05:03
Intro to CLR ThreadPool Growth

ThreadPool Growth: Some Important Details

The CLR ThreadPool has two types of threads - "Worker" and "I/O Completion Port" (aka IOCP) threads.

  • Worker threads are used when for things like processing Task.Run(…) or ThreadPool.QueueUserWorkItem(…) methods. These threads are also used by various components in the CLR when work needs to happen on a background thread.
  • IOCP threads are used when asynchronous IO happens (e.g. reading from the network).

The thread pool provides new worker threads or I/O completion threads on demand (without any throttling) until it reaches the "Minimum" setting for each type of thread. By default, the minimum number of threads is set to the number of processors on a system.

Once the number of existing (busy) threads hits the "minimum" number of threads, the ThreadPool will throttle the rate at which is injects new threads to one thread per 500 milliseconds. This means that if your system gets a burst of work needing an IOCP thread, it will proces

@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active July 12, 2024 09:40
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.