View demangle.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __LK_DEMANGLE_H__ | |
#define __LK_DEMANGLE_H__ | |
#if __has_include(<cxxabi.h>) | |
#include <cxxabi.h> | |
#include <cstdlib> | |
#include <memory> | |
#endif | |
#include <string> |
View kill_sponsored_facebook.user.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Remove Sponsored Facebook Elements | |
// @description Remove sponsored items from feed. | |
// @author Turing Eret | |
// @namespace us.lambdacalcul | |
// @version 0.1 | |
// @copyright Copyright © 2020 Turing Eret | |
// @license MIT | |
// @match https://*.facebook.com/* | |
// @grant none |
View enumish.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.annotation.{StaticAnnotation, compileTimeOnly} | |
import scala.language.experimental.macros | |
import scala.reflect.macros.whitebox | |
trait EnumishValue extends Ordered[EnumishValue] with java.lang.Comparable[EnumishValue] { | |
def id: Int | |
def compare(that: EnumishValue) = this.id - that.id | |
} | |
@compileTimeOnly("enable macro paradise to expand macro annotations") |
View gist:9982115
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE RankNTypes #-} | |
module AList where | |
import Control.Lens | |
type AList t = [(String, t)] | |
alistGet :: String -> AList t -> Maybe t | |
alistGet key ((k,v):xs) |
View gist:9260629
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SomeTraits.scala | |
trait Foo { | |
def someNumbers: List[Int] | |
def getNumbers : List[Int] = someNumbers | |
} | |
trait FilteredFoo extends Foo { | |
def numberFilter : Int => Boolean |
View gist:9061411
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace us.lambdacalcul.collections | |
{ | |
public class PriorityDeque<T, P> | |
{ |
View gist:8465187
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tree :: Tree Int | |
tree = Node 1 [ Node 2 [], Node 3 [] ] | |
test = zipper tree | |
& downward branches | |
& withins traverse | |
<&> downward root | |
<&> focus %~ (\x -> x + 10) | |
<&> rezip | |
-- Node {rootLabel = 1, subForest = [Node {rootLabel = 12, subForest = []},Node {rootLabel = 3, subForest = []}]} |
View gist:7378549
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait AttributeName { self => | |
type AttributeType | |
def of(value : AttributeType) : Attribute = new Attribute { | |
type Name = self.type | |
val Value = value | |
} | |
} | |
trait Attribute { |
View gist:6166631
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* <---- Add extra / on this line to uncomment first block and comment second block! | |
Function1(); | |
/*/ | |
Function2(); | |
//*/ | |
//* | |
Function1(); | |
/*/ | |
Function2(); |
View gist:5548767
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
public sealed class Maybe<T> | |
{ | |
private readonly bool _hasValue; | |
private readonly T _value; |
NewerOlder