Skip to content

Instantly share code, notes, and snippets.

View RredCat's full-sized avatar

Taras Romanyk RredCat

View GitHub Profile
@welshstew
welshstew / groovy-zip.groovy
Created March 5, 2015 04:41
groovy script to zip and unzip text/String content
// Simple groovy script to compress / decompress Strings
import java.util.zip.GZIPInputStream
import java.util.zip.GZIPOutputStream
def zip(String s){
def targetStream = new ByteArrayOutputStream()
def zipStream = new GZIPOutputStream(targetStream)
zipStream.write(s.getBytes('UTF-8'))
zipStream.close()
def zippedBytes = targetStream.toByteArray()
@odytrice
odytrice / Ninject.Http.cs
Last active February 14, 2023 12:15
A small Library to configure Ninject (A Dependency Injection Library) with a WebAPI Application.
using Ninject.Modules;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Http;
using System.Web.Http.Dependencies;
// A small Library to configure Ninject (A Dependency Injection Library) with a WebAPI Application.
@odytrice
odytrice / Ninject.Mvc.cs
Last active December 12, 2022 11:48
A small Library to configure Ninject (A Dependency Injection Library) with an ASP.NET Application.
using Ninject;
using Ninject.Modules;
using Ninject.Web.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Mvc;