Skip to content

Instantly share code, notes, and snippets.

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

Filip W filipw

🦄
¯\_(ツ)_/¯
View GitHub Profile
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;
  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

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)
{
@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 **
# 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: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)
{
  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:9846071
Last active May 3, 2016 18:02
ASP.NET Web API hosted in Azure Worker Role with OWIN in F#
namespace WebApi.AzureWorker
open Owin
open System
open System.Diagnostics
open System.Net
open System.Threading
open System.Net.Http
open System.Web.Http
open Microsoft.Owin.Hosting
@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"];
};
}