Skip to content

Instantly share code, notes, and snippets.

View petarvucetin's full-sized avatar

Petar Vučetin petarvucetin

  • Clear Lines
  • Los Angeles
View GitHub Profile
@badamczewski
badamczewski / BitSet.cs
Created December 1, 2020 13:08
BloomFilter Source Code
using System;
using System.Collections.Generic;
using System.Text;
namespace ProbabilisticDataStructures.DataStructures
{
public class BitSet
{
private ulong[] bitset;
public int Size { get; private set; }
@davidfowl
davidfowl / Example1.cs
Last active June 19, 2024 16:41
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@kipyegonmark
kipyegonmark / squid.conf
Created March 12, 2016 16:18
Sample configuration for squid proxy server. Source here -> https://calomel.org/squid.html
#
### Calomel.org Squid squid.conf
#
########### squid.conf ###########
#
## interface, port and proxy type
#http_port 10.10.10.1:8080 transparent
http_port 10.10.10.1:8080
## general options
@toast38coza
toast38coza / github_repo.py
Created February 9, 2016 18:05
An Ansible module for managing github repos
#!/usr/bin/python
DOCUMENTATION = '''
---
module: github_repo
short_description: Manage your repos on Github
'''
EXAMPLES = '''
- name: Create a github Repo
@crisidev
crisidev / grafana-dashboard-exporter
Created October 7, 2015 20:35
Command to export all grafana 2 dashboard to JSON using curl
KEY=XXXXXXXXXXXX
HOST="https://metrics.crisidev.org"
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json
done
@jbogard
jbogard / PurgeAllPrivateQueues.ps1
Created February 14, 2013 15:54
Purge all private queues
[Reflection.Assembly]::LoadWithPartialName("System.Messaging")
[System.Messaging.MessageQueue]::GetPrivateQueuesByMachine("localhost") | % { $_.Purge() }
@jbogard
jbogard / DeleteAllPrivateQueues.ps1
Last active December 13, 2015 18:09
Delete all private queues
[Reflection.Assembly]::LoadWithPartialName("System.Messaging")
[System.Messaging.MessageQueue]::GetPrivateQueuesByMachine("localhost") | % { [System.Messaging.MessageQueue]::Delete($_.Path) }
@jmangelo
jmangelo / VstoAopExceptionHandling.cs
Created February 17, 2010 21:25
Helpers classes for centralized exception handling in a VSTO add-in using PostSharp.
using System;
using log4net;
using PostSharp.Laos;
// http://exceptionalcode.wordpress.com/2010/02/17/centralizing-vsto-add-in-exception-management-with-postsharp/
namespace Helpers.Vsto.ErrorHandling
{
[Serializable]
public sealed class ExecutionEntryPointAttribute : OnExceptionAspect