Skip to content

Instantly share code, notes, and snippets.

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();
#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 / 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

@andycmaj
andycmaj / haproxy.1.cfg
Created September 7, 2017 10:12 — forked from badsyntax/haproxy.1.cfg
Some example haproxy configs
# SSL termination at proxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
@andycmaj
andycmaj / amazon-track-lookup.php
Created December 9, 2018 22:13 — forked from hubgit/amazon-track-lookup.php
find a track in Amazon's MP3 download store
<?php
// documentation: http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=19
class Amazon {
// Fill these in; the associate tag is optional
private $key = ''; // https://aws-portal.amazon.com/gp/aws/developer/account/index.html?action=access-key
private $secret = ''; // https://aws-portal.amazon.com/gp/aws/developer/account/index.html?action=access-key
private $tag = ''; // https://affiliate-program.amazon.com/
@andycmaj
andycmaj / neo4j-kakfa-demo.md
Created December 11, 2018 23:35 — forked from graphadvantage/ neo4j-kakfa-demo.md
Neo4j GraphGist: Enterprise Architectures - Real-time Neo4j Graph Updates using Kafka Messaging

##Neo4j GraphGist - Enterprise Architectures: Real-time Graph Updates using Kafka Messaging

Neo4j Use Case: Low Latency Graph Analytics & OLTP - Update 1M Nodes in 90 secs with Kafka and Neo4j Bolt

Introduction

A recent Neo4j whitepaper describes how Monsanto is performing real-time updates on a 600M node Neo4j graph using Kafka to consume data extracted from a large Oracle Exadata instance.

This modern data architecture combines a fast, scalable messaging platform (Kafka) for low latency data provisioning and an enterprise graph database (Neo4j) for high performance, in-memory analytics & OLTP - creating new and powerful real-time graph analytics capabilities for your enterprise applications.

@andycmaj
andycmaj / karabiner-elements-remote-desktop.json
Created November 6, 2021 19:04 — forked from DennyWeinberg/rdp.json
Karabiner Elements JSON configuration for Microsoft Remote Desktop
{
"title": "Microsoft Remote Desktop",
"rules": [
{
"description": "Windows Mappings",
"manipulators": [
{
"type": "basic", "description": "Completely disabled the windows key (Startmenu)",
"from": { "key_code": "left_command" },
"to": [ { "key_code": "left_control" } ],