Skip to content

Instantly share code, notes, and snippets.

View hazer-hazer's full-sized avatar
🤏
lolkeking right now

Hazer Hazer hazer-hazer

🤏
lolkeking right now
View GitHub Profile
@aminzai
aminzai / CppGetSetMacros
Created May 16, 2012 02:25
C++ GET/SET Macros
#ifndef __GETSET_DECL_
#define __GETSET_DECL_
#include "wx/wxprec.h"
#define GETSET(Type, MemberName, FaceName) \
Type Get##FaceName() const { \
return MemberName; \
}; \
void Set##FaceName(Type value) { \
@paulmillr
paulmillr / type-inference.coffee
Created July 17, 2012 17:39
Damas-Hindley-Milner type inference algorithm in LiveScript
# Algorithm W (Damas-Hindley-Milner) in LiveScript.
# By Paul Miller (paulmillr.com), Public domain.
#
# Based on Robert Smallshire's [Python code](http://bit.ly/bbVmmX).
# Which is based on Andrew's [Scala code](http://bit.ly/aztXwD).
# Which is based on Nikita Borisov's [Perl code](http://bit.ly/myq3uA).
# Which is based on Luca Cardelli's [Modula-2 code](http://bit.ly/Hjpvb).
# Something like that.
prelude = require './prelude'
@XVilka
XVilka / TrueColour.md
Last active June 27, 2024 11:24
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@mawenbao
mawenbao / Makefile
Created February 26, 2014 05:16
googletest simple example
# Makefile for gtest examples
GOOGLE_TEST_LIB = gtest
GOOGLE_TEST_INCLUDE = /usr/local/include
G++ = g++
G++_FLAGS = -c -Wall -I $(GOOGLE_TEST_INCLUDE)
LD_FLAGS = -L /usr/local/lib -l $(GOOGLE_TEST_LIB) -l pthread
OBJECTS = main.o string-compare.o
@nabijaczleweli
nabijaczleweli / variadic-template-iterate.hpp
Last active June 13, 2021 21:35
Iterate over all elements of variadic template
#include <cstddef>
#include <utility>
template<class T, class... TT>
struct over_all {
using next = over_all<TT...>;
static const constexpr std::size_t size = 1 + next::size;
template<class C>
@oxyflour
oxyflour / hindley-milner.ts
Last active May 3, 2024 01:32
a typescript implement of hindley-milner type inference
// a typescript implement of hindley-milner type inference
// reference http://smallshire.org.uk/sufficientlysmall/2010/04/11/a-hindley-milner-type-inference-implementation-in-python/
/// <reference path="./lib.es6.d.ts" />
// ...
interface AstNode {
}
class Id implements AstNode {

In this tutorial we're going to build a set of parser combinators.

What is a parser combinator?

We'll answer the above question in 2 steps.

  1. What is a parser?
  2. and, what is a parser combinator?

So first question: What is parser?

@louthy
louthy / recon.ml
Created November 6, 2018 02:02 — forked from kseo/recon.ml
A Hindley-Milner type inference implementation in OCaml
#! /usr/bin/env ocamlscript
Ocaml.ocamlflags := ["-thread"];
Ocaml.packs := [ "core" ]
--
open Core.Std
type term =
| Ident of string
| Lambda of string * term
| Apply of term * term
@balmeida-nokia
balmeida-nokia / wsl2_ciscoanyconnect_workaround.md
Last active June 4, 2024 10:45 — forked from pyther/wsl2_ciscoanyconnect_workaround.md
WSL 2 Cisco AnyConnect Networking Workaround

WSL 2 Cisco AnyConnect Networking Workaround

Overview

WSL 2 uses a Hyper-V Virtual Network adapter. Network connectivity works without any issue when a VPN is not in use. However when a Cisco AnyConnect VPN session is established Firewall Rules and Routes are added which breaks connectivity within the WSL 2 VM. This issue is tracked WSL/issues/4277

Below outline steps to automatically configure the Interface metric on VPN connect and update DNS settings (/etc/resolv.conf) on connect/disconnect.

Acknowledges

@suhr
suhr / proofs.md
Last active December 8, 2022 13:05

Упражнения по формальным доказательствам

Нет времени объяснять, переходим сразу к делу.

Инструменты

Доказывать теоремы мы будем, используя интерактивные пруверы Isabelle или Lean 3. Примеры приводятся для каждого прувера, для решения задач же можно использовать любой из них.