Skip to content

Instantly share code, notes, and snippets.

@spacekitteh
spacekitteh / aosp.md
Created December 23, 2016 06:47 — forked from thestinger/aosp.md
NOT READY FOR PUBLISHING (i.e. future blog post): notes about problems with the Android Open Source Project

The Neglected Android Open Source Project

What is the Android Open Source Project?

The Android Open Source Project is essentially the Android source code for Nexus devices and the Pixel C. However, it's somewhat different from the internal source tree used to build stock Android for those devices.

It's important to note that it's only closely tied to the internal source code for stable releases. The master branch of AOSP does not closely track the internal development. The internal work is released as part of a stable update, and then merged into the AOSP master branch afterwards. AOSP master and the internal source tree are repeatedly merged into each other to some extent during a year of development, as some work happens out in the open (lots of the low-level userspace work) while other work happens internally. For some repositories, there's substantial amounts of both. The merges are primarily from AOSP into the internal tree until new stable source code is released. These strange workflows result

{ config, pkgs, ... }:
{
imports = [ ./default.nix /root/nixcfg/core.nix ];
services = {
example = {
enable = true;
};
};
environment.systemPackages = with pkgs; [ wget tcpdump ltrace gdb ];
@spacekitteh
spacekitteh / whiteboardCleaner.md
Created December 18, 2015 03:08 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

class Uniplate on where
-- | The underlying method in the class.
-- Taking a value, the function should return all the immediate children
-- of the same type, and a function to replace them.
--
-- Given @uniplate x = (cs, gen)@
--
-- @cs@ should be a @Str on@, constructed of @Zero@, @One@ and @Two@,
-- containing all @x@'s direct children of the same type as @x@. @gen@
-- should take a @Str on@ with exactly the same structure as @cs@,
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7102" }:
let
inherit (nixpkgs) pkgs;
ghc = pkgs.haskell.packages.${compiler}.ghcWithPackages (ps: with ps;
[ ghc-mod mtl lens parsec QuickCheck ansi-wl-pprint text text-format annotated-wl-pprint cabal-install
alex zippers compdata
happy monad-logger hlint unordered-containers ekg haskeline
smartcheck sbv tasty optparse-applicative configurator
leksah data-category
structured-haskell-mode]);
{-# LANGUAGE TemplateHaskell, TypeOperators #-}
{-# LANGUAGE FlexibleContexts #-}
--------------------------------------------------------------------------------
-- |
-- Module : Examples.Common
-- Copyright : (c) 2011 Patrick Bahr, Tom Hvitved
-- License : BSD3
-- Maintainer : Tom Hvitved <hvitved@diku.dk>
-- Stability : experimental
-- Portability : non-portable (GHC Extensions)
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")
((nil
(eval progn
(setq default-directory
(locate-dominating-file buffer-file-name ".dir-locals.el"))
(load-file "./shell.el"))))
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7102" }:
let
inherit (nixpkgs) pkgs;
ghc = pkgs.haskell.packages.${compiler}.ghcWithPackages (ps: with ps;
[mtl lens parsec QuickCheck ansi-wl-pprint text text-format alex
happy monad-logger hlint unordered-containers ekg haskeline
/*smartcheck*/ sbv tasty optparse-applicative configurator ]);
texlive = pkgs.texLiveFull;
emacs = let withGTK3 = true; in pkgs.emacsWithPackages (with
pkgs.emacsPackagesNg; [ghc-mod haskell-mode structured-haskell-mode]);
newtype TermFormerID = TermFormerID Natural deriving (Eq, Show)
-- Used for dynamic sequences of name usage. For example, memory locations in an imperitive program. Models binding arities.
data BindingToken a = Create Name
| Destroy Name
| RawTerm a
| Constant a deriving (Eq, Show, Functor, Foldable, Traversable)
data NominalTerm a = Atom Name
| Variable Permutation Name
{-#LANGUAGE PolyKinds, TypeFamilies, TypeOperators, ConstraintKinds, UndecidableInstances, FlexibleInstances, FunctionalDependencies, MultiParamTypeClasses, TypeOperators, KindSignatures #-}
import qualified Prelude ((.), id, String)
import Data.Proxy
import GHC.Exts
import GHC.TypeLits
class SmallCategory cat where
name :: Proxy cat -> Prelude.String
id ::(Objects cat a, CategoryMorphism cat morph) => morph a a
type Objects cat :: a -> Constraint