Skip to content

Instantly share code, notes, and snippets.

View ayseff's full-sized avatar
🎯
Focusing

Avraham Seff ayseff

🎯
Focusing
  • Greater New York City Area
View GitHub Profile
@ayseff
ayseff / HelloWorldController.cs
Created January 21, 2018 03:35 — forked from AlexZeitler/HelloWorldController.cs
A super simple "Hello World" Controller for ASP.NET Web API
using System.Web.Http;
namespace KatanaWebApiAndStaticConsole {
public class HelloWorldController : ApiController {
public string Get() => "Hello World";
}
}
}
@ayseff
ayseff / example.cs
Created December 11, 2017 02:03 — forked from brandonmwest/example.cs
Generating base64-encoded Authorization headers in a variety of languages
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Basic",
Convert.ToBase64String(
System.Text.ASCIIEncoding.ASCII.GetBytes(
string.Format("{0}:{1}", username, password))));
@ayseff
ayseff / app.config
Last active November 26, 2017 19:47 — forked from grenade/app.config
Emit log4net entries to logstash over UDP in near-realtime
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<log4net>
<appender name="UdpAppender" type="log4net.Appender.UdpAppender">
@ayseff
ayseff / WindowsFormToXaml.cs
Created October 15, 2017 20:52 — forked from CADbloke/WindowsFormToXaml.cs
Windows Forms to XAML Converter
// based on http://robrelyea.wordpress.com/2007/02/10/winforms-xaml/
// converted to an Extension Method by @CADbloke
// a list: http://msdn.microsoft.com/en-us/library/ms750559(v=vs.110).aspx
// here's moar code:http://wf2wpf.codeplex.com/SourceControl/latest but it converts source files, not actual controls.
// Here's a site that does code too http://www.win2wpf.com/
// http://www.codeproject.com/Articles/25795/Creating-the-Same-Program-in-Windows-Forms-and-WPF
// ReSharper disable SpecifyACultureInStringConversionExplicitly
using System;
@ayseff
ayseff / 0_reuse_code.js
Created April 18, 2014 22:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console