Skip to content

Instantly share code, notes, and snippets.

View evilz's full-sized avatar
🏠
F# F# F#

Vincent B. evilz

🏠
F# F# F#
View GitHub Profile
@evilz
evilz / ADGroup.cs
Last active August 29, 2015 14:07
Active Directory Entity classes
using System.DirectoryServices;
namespace ActiveDirectory.Model
{
[DirectorySchema("group")]
public class ADGroup : DirectoryEntity , IDirectoryEntity
{
[DirectoryAttribute("name")]
public string name
@evilz
evilz / Infector_Main.cs
Last active August 29, 2015 14:11
Infector review1
using DllInjection.Services;
using EasyHook;
using System;
using System.CodeDom.Compiler;
using System.Diagnostics;
using System.IO;
using System.Runtime.Remoting;
namespace DllInfector
{
public class GoogleMapsAPIProjection
{
private readonly double PixelTileSize = 256d;
private readonly double DegreesToRadiansRatio = 180d / Math.PI;
private readonly double RadiansToDegreesRatio = Math.PI / 180d;
private readonly PointF PixelGlobeCenter;
private readonly double XPixelsToDegreesRatio;
private readonly double YPixelsToRadiansRatio;
public GoogleMapsAPIProjection(double zoomLevel)
@evilz
evilz / FizzBuzz.md
Last active September 9, 2015 13:31
KATA

FizzBuzz

Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz"" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz". Print a new line after each string or number.

<UserSettings><ApplicationIdentity version="12.0"/><ToolsOptions><ToolsOptionsCategory name="Environment" RegisteredName="Environment"/></ToolsOptions><Category name="Environment_Group" RegisteredName="Environment_Group"><Category name="Environment_FontsAndColors" Category="{1EDA5DD4-927A-43a7-810E-7FD247D0DA1D}" Package="{DA9FB551-C724-11d0-AE1F-00A0C90FFFC3}" RegisteredName="Environment_FontsAndColors" PackageName="Visual Studio Environment Package"><PropertyValue name="Version">2</PropertyValue><FontsAndColors Version="2.0"><Theme Id="{DE3DBBCD-F642-433C-8353-8F1DF4370ABA}"/><Categories><Category GUID="{58E96763-1D3B-4E05-B6BA-FF7115FD0B7B}" FontIsDefault="Yes"><Items><Item Name="Plain Text" Foreground="0x00FFFFFF" Background="0x002D3239" BoldFont="No"/><Item Name="Selected Text" Foreground="0x02000000" Background="0x008FA2AF" BoldFont="No"/><Item Name="Inactive Selected Text" Foreground="0x02000000" Background="0x00DBCDBF" BoldFont="No"/><Item Name="Indicator Margin" Foreground="0x02000000" Background="0x
@evilz
evilz / CanDoRansom
Created March 23, 2016 17:59
Criteo Skype meeting
public static bool CanDoRansom(this List<string> ransomNote, List<string> newspaper)
{
// N
// M
O(M + N)
foreach(var paper in newspaper){
@evilz
evilz / NotifyHelper
Created April 3, 2016 10:00
SetField for notify
public static class NotifyHelper
{
public static bool SetField<T,F>(this T target,ref F field, F value, Action<T> callback)
{
if (EqualityComparer<F>.Default.Equals(field, value)) return false;
field = value;
callback?.Invoke(target);
return true;
}
}
@evilz
evilz / Printer.cs
Created April 25, 2016 13:50
UglyWTF
using System;
namespace UglyWTF
{
public static class Printer
{
public static void Print(string message)
{
Console.WriteLine(message);
}
@evilz
evilz / IIS_Remote_access.md
Created May 29, 2016 19:55
IIS express Remote access

Tell IIS Express itself to bind to all ip addresses and hostnames. In your .config file. Typically: VS 2015: $(solutionDir).vs\config\applicationhost.config < VS 2015: %userprofile%\My Documents\IISExpress\config\applicationhost.config Find your site's binding element, and add

<binding protocol="http" bindingInformation="*:8080:*" />

Setup the bit of Windows called 'http.sys'. As an administrator, run the command: netsh http add urlacl url=http://*:8080/ user=everyone Where everyone is a windows group. Use double quotes for groups with spaces like "Tout le monde".

@evilz
evilz / TestResponse.ashx
Created October 24, 2016 12:10
Handler to check Http status code
<%@ WebHandler Language="C#" Class="TestResponse" %>
using System;
using System.Web;
public class TestResponse : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
var r = context.Response;