Skip to content

Instantly share code, notes, and snippets.

@andycmaj
andycmaj / swagger_json_to_yaml.rb
Created May 21, 2013 04:07
Convert swagger JSON api definition to YAML - Requires http://rubygems.org/gems/crack
#!/usr/bin/env ruby
require 'crack'
# json file with api definition
in_file_name = ARGV[0]
# yaml file output
out_file_name = ARGV[1]
@andycmaj
andycmaj / swagger_yaml_to_json.rb
Created May 21, 2013 04:39
Convert Swagger YAML api definition to JSON
#!/usr/bin/env ruby
require 'yaml'
require 'json'
# yaml file with api definition
in_file_name = ARGV[0]
# json file output
out_file_name = ARGV[1]

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

public static class NinjectScopingLearning
{
public static class InParentScope
{
[Fact]
public static void WorksIffParentScopeAllWayUp()
{
var kernel = new StandardKernel();
kernel.Bind<Root>().ToSelf().InSingletonScope();
kernel.Bind<Child>().ToSelf().InParentScope();
Disable-UAC
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop
cinst winsshd.install
POSSIBLE INSTALL OPTIONS (Pass additional or override
-installDir=directory OR -defaultSite OR -site=site-name (Default -installDir is "%ProgramFiles%\Bitvise SSH Server", -defaultSite is "Bitvise SSH Server")
[-acceptEULA]
[-force] Pass this option to install regardless if any program files to be updated are locked by another process.
[-noRollback]
#ss to gif
import os
from PIL import Image
working_directory = r'C:\temp'
file_names = sorted((fn for fn in os.listdir(working_directory) if fn.endswith('.png')))
file_names = file_names
@andycmaj
andycmaj / CustomAsymmetricSignatureProvider.cs
Created September 6, 2016 19:26
Working Mono AsymmetricCryptoProvider
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using Microsoft.Extensions.Logging;
using Microsoft.IdentityModel.Tokens;
namespace TheChunnel.FrontEnd
{
/// <summary>
/// https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/e6d903b4f8d3c6d7697dc70cd54ae905b18b65fe/src/System.IdentityModel.Tokens.Jwt/AsymmetricSignatureProvider.cs
@andycmaj
andycmaj / Example1.cs
Created September 8, 2016 04:58 — forked from davidfowl/Example1.cs
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@andycmaj
andycmaj / ASPNET-MVC-OSX-Apache.md
Created March 7, 2017 06:59 — forked from labaneilers/ASPNET-MVC-OSX-Apache.md
Setting up ASP.NET MVC 5 via Mono on Mac OSX, with Apache

Install ASP.NET MVC 5 on Mono, Mac OSX, apache with mod_mono

Install mono MDK

  • NOTE: no x64 package is available (unless you want to install from source), so I installed the x86 version

  • Install mono MDK from:

http://www.mono-project.com/download/

I used 3.10.0, which corresponds to .NET 4.5