Skip to content

Instantly share code, notes, and snippets.

View LnL7's full-sized avatar
❄️
1970 /nix/store

Daiderd Jordan LnL7

❄️
1970 /nix/store
View GitHub Profile
(define (fill-pixel! x y colour)
(WriteSpiCommand! PASET y)
(WriteSpiCommand! CASET x)
(WriteSpiCommand! RAMWR)
(spi-put SPI_0 colour))
(load "ICP1_2b_regsim.scm")
(define (assemble-and-run p)
(define m (make-machine
'(cont res val_1 val_2)
`((+ ,+)(* ,*)(- ,-)(= ,=)(< ,<)(> ,>)(display ,(lambda (x)(display x)(newline))))
p))
(start m)
(display (get-register-contents m 'res)))
@LnL7
LnL7 / luvit.rb
Last active December 28, 2017 12:36 — forked from nuxlli/luvit.rb
require 'formula'
class Luvit < Formula
homepage 'http://luvit.io'
url 'http://luvit.io/dist/latest/luvit-0.6.1.tar.gz'
sha1 'f5e49a33e0e32d8e75d5cdd843d54f213f6e508e'
head 'https://github.com/luvit/luvit.git'
def install
ENV.j1 # if your formula's build system can't parallelize
@LnL7
LnL7 / gist:6220979
Last active December 21, 2015 00:29
defmodule Words do
def count(input) do
input |> String.downcase
|> (&Regex.scan(%r/\w+/, &1)).()
|> List.flatten
|> count_words
end
defp count_words(words) do
increment = &(&1 + 1)
@LnL7
LnL7 / webtoolkit.rb
Last active December 31, 2015 03:29
require 'formula'
class Webtoolkit < Formula
homepage 'http://webtoolkit.eu'
sha1 '0ae889c1411864d783962d4878b90efbce7f3382'
stable do
url 'http://downloads.sourceforge.net/project/witty/wt/3.3.1/wt-3.3.1.tar.gz'
end
@LnL7
LnL7 / FromJsonConduit.hs
Created February 7, 2014 14:00
Fetching JSON using http-conduit and aeson
{-# LANGUAGE OverloadedStrings #-}
import Control.Applicative (Applicative, (<$>), (<*>))
import Control.Monad (mzero)
import Data.Aeson (Value(..), FromJSON, (.:), parseJSON)
import Data.ByteString (ByteString)
import Data.Text (Text)
import Network.HTTP.Conduit (Response)
import qualified Data.Aeson as A
import qualified Data.Aeson.Parser as AP
import qualified Data.ByteString as B
@LnL7
LnL7 / ffind.zsh
Created February 3, 2015 13:58
find with ignorefile support
ffind() {
local -a ignoreargs ignores args
if [[ -e $HOME/.ffignore ]]; then
ignores=( ${(f)"$(< $HOME/.ffignore)"} )
for ignore in $ignores; do
ignoreargs+=( -o -name "$ignore" )
done
fi
while true; do
case "$1" in
@LnL7
LnL7 / config.nix
Last active August 29, 2015 14:19
{ pkgs }:
{
allowBroken = true;
allowUnfree = true;
haskellPackageOverrides = self : super : (let inherit (pkgs.haskell-ng) lib; in {
shake = lib.dontCheck super.shake;
zip-archive = lib.dontCheck super.zip-archive;
});

Keybase proof

I hereby claim:

  • I am LnL7 on github.
  • I am lnl7 (https://keybase.io/lnl7) on keybase.
  • I have a public key whose fingerprint is 4515 57DF CA15 E299 CE0D D787 7AE2 5D96 3B18 89DD

To claim this, I am signing this object:

@LnL7
LnL7 / config.nix
Last active August 29, 2015 14:22 — forked from gilligan/config.nix
{ pkgs }:
{
allowBroken = true;
allowUnfree = true;
haskellPackageOverrides = self : super : (let inherit (pkgs.haskell-ng) lib; in {
ghc-mod = lib.overrideCabal super.ghc-mod (oldAttrs: {
src = pkgs.fetchgit {
url = https://github.com/kazu-yamamoto/ghc-mod;