Skip to content

Instantly share code, notes, and snippets.

@scovetta
scovetta / NuGetList.cs
Created October 31, 2016 04:31
NuGet.Core Parsing Bug
using System;
using System.Linq;
using NuGet;
namespace NuGetListNamespace
{
class NuGetList
{
static void Main(string[] args)
{
test()

foo bar baz

@scovetta
scovetta / urlencoder
Created September 16, 2014 06:03
Caching URL encoder for Perl
#!/usr/bin/perl -w
use strict;
use warnings;
use feature (qw/state/);
sub encode {
state %hashMap;
if (not %hashMap) {
%hashMap = ();
Ingredients :
1/2 stick of butter
6-8 cloves of garlic sliced thinly
1 1/2 bottle of Franks
1/2 to 3/4 bag (5;b) of frozen or fresh wing parts
Procedure :
Add 3/4 of Franks, 1/4 stick of butter and garlic in skillet and simmer on low for 10 minutes.
Add wings and flip them to coat thoroughly. Cover and simmer on low for appx. 20 minutes (for frozen).
After 10 minutes, preheat your girll on high.
After 20 minutes, transfer wings from skillet into big bowl and bring to grill.
@scovetta
scovetta / Nginx-Optimized
Last active September 1, 2021 07:30
Optimized Nginx configuration, from http://dak1n1.com/blog/12-nginx-performance-tuning
# This number should be, at maximum, the number of CPU cores on your system.
# (since nginx doesn't benefit from more than one worker per CPU.)
worker_processes 24;
# Number of file descriptors used for Nginx. This is set in the OS with 'ulimit -n 200000'
# or using /etc/security/limits.conf
worker_rlimit_nofile 200000;
# only log critical errors
error_log /var/log/nginx/error.log crit
@scovetta
scovetta / django-admin-autoregister.py
Created August 3, 2012 17:56
Django Automatic Model Registration for Django Admin
"""
This gist allows you to automatically register all models in a given app
for use in the Django Admin application.
Change (your-app-name) to your application name.
"""
import inspect
from django.contrib.admin.sites import AlreadyRegistered
from (your-app-name) import models