Skip to content

Instantly share code, notes, and snippets.

View dhbaird's full-sized avatar

David Baird dhbaird

View GitHub Profile
@jdnavarro
jdnavarro / lattice.md
Last active June 20, 2021 14:13
Idealized Haskell type class lattice

This is a personal mental model of how I would classify Haskell main type classes if semigroupoids were first-class.

Functor: <$>

  • Apply: <*>, <.>
    • Applicative: pure, return
    • Bind: join, =<<, <=<
  • Alternative (Alt): <|>, <!>
    • Zero (Alternative): zero, empty
  • CoApply: <@>
  • CoApplicative: copure, extract
@vrillusions
vrillusions / _README.mkd
Last active January 24, 2023 16:18
Kickstart for Ubuntu 14.04
@kwk
kwk / get_flename_of_decl.cxx
Last active March 28, 2017 20:56
Get filename/path of clang::Decl
static const clang::FileEntry * getFileEntryForDecl(const clang::Decl * decl, clang::SourceManager * sourceManager)
{
if (!decl || !sourceManager) {
return 0;
}
clang::SourceLocation sLoc = decl->getLocation();
clang::FileID fileID = sourceManager->getFileID(sLoc);
return sourceManager->getFileEntryForID(fileID);
}
@mariocesar
mariocesar / runserver.py
Created October 23, 2012 11:18
Runs the django dev server along with ´compass watch´ command. For fun and profit
import os
import subprocess
import atexit
import signal
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand
from django.core.management.commands.runserver import Command as RunserverCommand
@justjkk
justjkk / LICENSE
Last active January 7, 2025 17:30
Parsing JSON with lex and yacc
The MIT License (MIT)
Copyright (c) 2015 J Kishore Kumar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: