Skip to content

Instantly share code, notes, and snippets.

View adamralph's full-sized avatar
🤗
Living the dream

Adam Ralph adamralph

🤗
Living the dream
View GitHub Profile
namespace WebSocket
// Appache 2.0 license
// References:
// [1] Proposed WebSockets Spec December 2011 http://tools.ietf.org/html/rfc6455
// [2] John McCutchan (Google Dart Team Member) http://www.altdevblogaday.com/2012/01/23/writing-your-own-websocket-server/
// [3] A pretty good Python implemenation by mrrrgn https://github.com/mrrrgn/websocket-data-frame-encoder-decoder/blob/master/frame.py
// [4] WebSockets Organising body http://www.websocket.org/echo.html
// [5] AndrewNewcomb's Gist (starting point) https://gist.github.com/AndrewNewcomb/711664
@phillip-haydon
phillip-haydon / boxstarter-script
Last active October 1, 2023 22:02
My Boxstarter Script
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Set-StartScreenOptions -EnableBootToDesktop -EnableDesktopBackgroundOnStart -EnableShowStartOnActiveScreen -EnableShowAppsViewOnStartScreen -EnableSearchEverywhereInAppsView -EnableListDesktopAppsFirst
Install-WindowsUpdate -acceptEula
cinst notepad2
cinst SublimeText3
cinst sublimetext3-contextmenu
cinst git-credential-winstore
cinst ConEmu
cinst poshgit
@msugakov
msugakov / a.cs
Created April 27, 2014 19:13
C# program that starts process and combines its standart output and standard error in one stream
using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
class App
{
public static int ExecuteProcess(
string fileName,
string arguments,
@blairconrad
blairconrad / FIE_1.19.0_startup.md
Last active August 29, 2015 13:59
FakeItEasy 1.19.0 startup time improvements

In case anyone is interested, the faster FakeItEasy 1.19.0 startup does indeed seem to be faster. I started using 1.19.0 at the Day Job today, and got these results for a test run in the IDE (ReSharper test runner):

shadow copies no shadow copies
1.18.0 5.9s 2.5s
1.19.0 0.86s 0.63s
  1. Install SublimeREPL package from package control

  2. Install scriptcs package from package control

  3. Download this experimental build of scriptcs and extract to some folder on your machine

  4. go to ~/.config/sublime-text-2/Packages/SublimeREPL/config/ScriptCS and open Main.sublime-menu file

  5. Update the "linux" path in that file to "linux": ["mono", "PATH/TO/YOUR/scriptcs.exe", "-modules", "mono", "-repl"]

@filipw
filipw / app.csx
Last active November 4, 2015 19:34
#load "bootstrapper.csx"
public class IndexModule : NancyModule
{
public IndexModule()
{
Get["/"] = x => {
return View["index"];
};
}
@filipw
filipw / app.csx
Last active August 29, 2015 13:56
nancy on helios with OWIN and scriptcs
#load "bootstrapper.csx" //setup rootpathprovider and other stuff
public class IndexModule : NancyModule
{
public IndexModule()
{
Get["/"] = x => {
return View["index"];
};
}
@danbarua
danbarua / rakefile.rb
Created February 10, 2014 13:26
Albacore task to verify projects have StyleCop.MSBuild set up properly
desc "Checks .csproj files for StyleCop.MSBuild target"
task :verify_stylecop_msbuild do
projectFiles = FileList["./**/*.csproj"]
projectFiles.each{|f|
doc = Nokogiri::XML(File.open(f))
target = doc.css('PropertyGroup > StyleCopMSBuildTargetsFile')
if (target.empty?)
puts "#{f} has no stylecop.msbuild"
else
puts "#{f} is ok"
@glennblock
glennblock / non_scripty_way.csx
Last active August 29, 2015 13:56
Script packs as script
public class WebApi : IScriptPackContext {
public WebApi(ILog logger, IControllerTypeManager typeManager) {
...
}
}
public class WebApiScriptPack : IScriptPack
{
private readonly ILog _logger;
private readonly IControllerTypeManager _typeManager;
@damianh
damianh / Rename-Project.psm1
Last active May 25, 2018 23:10
Renames a csproj - Project Name, DirectoryName, AssemblyName and references to the project
# Works for me. You may need to tweak it. Stick it in your powershell profile FTW
function Rename-Project
{
# designed to run from the solution directory where the project is a child directory
param(
[string]$projectName=$(throw "projectName required."),
[string]$newProjectName=$(throw "newProjectName required.")
)