Skip to content

Instantly share code, notes, and snippets.

View filipw's full-sized avatar
🦄
¯\_(ツ)_/¯

Filip W filipw

🦄
¯\_(ツ)_/¯
View GitHub Profile
@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"];
};
}
  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 / gist:52d44baad6a888569150
Last active August 29, 2015 14:00
remove strong name
//usage
//removeStrongName.exe <path_to_strong_named.dll>
using System;
using System.IO;
public class Program
{
public static void Main(string[] args)
{
# brew install --HEAD https://gist.github.com/filipw/6cbc6394360142a1976e/raw/scriptcs.rb -v
# note: requires >= mono 3.6.1 (http://www.go-mono.com/mono-downloads/download.html)
require 'formula'
class Scriptcs < Formula
homepage 'https://github.com/scriptcs/scriptcs'
head 'https://github.com/scriptcs/scriptcs.git', :branch => 'master'
@filipw
filipw / gist:fe53ac8c57f87213c77c
Created March 28, 2015 12:21
all script packs
> :scriptpacks
Wharrgarbl.WharrgarblScriptPackContext
Superscribe.ScriptCS.SuperscribeCS
** Methods **
- void Listen()
ScriptCs.ReplCommand.Pack.ReplCommandPackContext
** Methods **
public class FromBodyApplicationModelConvention : IApplicationModelConvention
{
public void Apply(ApplicationModel application)
{
foreach (var controller in application.Controllers)
{
foreach (var action in controller.Actions)
{
foreach (var parameter in action.Parameters)
{
  1. Update VS Code settings to treat .csx as .cs

     win: C:\Users\username\AppData\Local\Code\app-0.1.0\resources\app\plugins\vs.language.csharp\ticino.plugin.json
     os x: \AppData\Local\Code\app-0.1.0\resources\app\client\vs\languages\vs.language.csharp\ticino.plugin.json
    

There is an extensions array there tht you should modify.

  1. Get omnisharp-roslyn and build

git clone https://github.com/OmniSharp/omnisharp-roslyn.git

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;
using NuGet.Frameworks;
using NuGet.Packaging;
@filipw
filipw / webapiScript.csx
Created September 27, 2012 10:42
Scripting self hosted Web API with Roslyn CTP
#r "C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Http.SelfHost.dll"
#r "C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Packages\Newtonsoft.Json.4.5.6\lib\net40\Newtonsoft.Json.dll"
#r "C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Http.dll"
#r "C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Net.Http.Formatting.dll"
#r "C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Net.Http.WebRequest.dll"
#r "C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Net.Http.dll"
#r "c:\Users\Filip\documents\visual studio 2012\Projects\Roslyn.WebApi\packages\Roslyn.Compilers.Common.1.2.20906.2\lib\net45\Roslyn.Compilers.dll"
#r "c:\users\filip\documents\visual studio 2012\Projects\Roslyn.WebApi\packages\Roslyn.Compilers.CSharp.1.2.20906.2\lib\net45\Roslyn.Compilers.CSharp.dll"
using System;
@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"];
};
}