Skip to content

Instantly share code, notes, and snippets.

@TheHunter
TheHunter / AppStart.cs
Last active December 19, 2016 17:53
A generic class for loading assemblies dynamically a runtime using a Resolver delegate.
public class AppStart
{
private static HashSet<Assembly> Dependencies;
// In this method the assemblies will be loaded into internal collection.
public static void AppInitialize()
{
Dependencies = new HashSet<Assembly>();
LoadDependencyAssemblies();
@joshgo
joshgo / load-and-init-assembly.cs
Created March 28, 2014 15:04
Dynamically load an assembly, and call the static constructor of a specific class.
private static void LoadAndInit(string assemblyPath, string className)
{
var assembly = System.Reflection.Assembly.LoadFile(assemblyPath);
RuntimeHelpers.RunClassConstructor(assembly.GetType(className).TypeHandle);
}
#I __SOURCE_DIRECTORY__
#r "libs/NuGet.Core.dll"
#r "System.Xml.Linq"
open NuGet
open System
open System.IO
module NuGet =
@P7h
P7h / jdk_download.sh
Last active May 5, 2025 10:36
Script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
@gimelfarb
gimelfarb / AssemblyDebugInfo.cs
Created January 27, 2014 02:05
Reading PDB symbol reference info (file, GUID, age) from a loaded Assembly
public static AssemblyDebugInfo ReadAssemblyDebugInfo(Assembly assembly)
{
// Parses PE headers structure from the module base address pointer
var modulePtr = Marshal.GetHINSTANCE(assembly.ManifestModule);
var peHdrs = PeHeaders.FromUnmanagedPtr(modulePtr);
// Depending on whether this is 32-bit or 64-bit module, the offsets are
// slightly different
@shinnya
shinnya / ReaderMonad.scala
Last active September 10, 2017 06:22
Reader Monad
/*
* Copyright (C) 2017 Shinya Yamaoka
* Licensed under the MIT License.; you may not use this file except in
* compliance with the license. You may obtain a copy of the License at
* https://opensource.org/licenses/mit-license.php
*/
object ReaderMonad {
class Reader[-E, +R] private (g: E => R) {
def apply(env: E): R = g(env)
@mavnn
mavnn / InstallThings.fsx
Created November 28, 2013 16:15
Install NuGet stuff from code with sensible control of options.
(* Get the files in the right places relative to the script by running:
path\to\NuGet.exe install NuGetPlus.Core -ExcludeVersion -Prerelease
*)
#r "FSharp.Core"
#r "Microsoft.Build"
#r "Microsoft.Build.Framework"
#r "System.Xml"
#r "System.Xml.Linq"
@Y4suyuki
Y4suyuki / README.md
Last active March 14, 2022 08:00
Monad

Monad

What is Monad?

A monad M is a parametric type M[T] with two operations flatMap and unit that have to satisfy some laws.

trait M[T] {
  def flatMap[U](f: T => M[U]): M[U]
}

def unit[T](x: T): M[T]
@daleobrien
daleobrien / ncurses_stl.cpp
Created November 18, 2013 21:19
A general purpose example of using ncurses in C++ e.g. with STL strings. Note: copied from http://pastebin.com/jRK9C129
/* ncurses C++
*
* A general purpose example of using ncurses in C++ e.g. with STL strings.
* I guess whatever license ncurses uses applies, otherwise public domain.
*/
# include <algorithm>
# include <iostream>
# include <fstream>
# include <iterator>

Haskell Skills

  • Advanced type-level programming (GADTs, TypeFamilies, proofs, etc.)
  • Agile software development
  • Artificial Intelligence
  • Attribute Grammar
  • Bioinformatics
  • Cabal internals
  • Categorical Programming
  • Compilers