Skip to content

Instantly share code, notes, and snippets.

View schell's full-sized avatar
🥑
mmm

Schell Carl Scivally schell

🥑
mmm
View GitHub Profile
@schell
schell / unlit.md
Last active May 21, 2018 16:17
markdown-unlit for fintan

This is a markdown headline

Here we'll write some comments

Now let's do some more stuff

Under the subheadline we have more comments, and finally some code:

main :: IO ()
main = putStrLn "blarg!"

That was the main.

@schell
schell / keybase.md
Created August 14, 2018 20:07
keybase.md

Keybase proof

I hereby claim:

  • I am schell on github.
  • I am schellsan (https://keybase.io/schellsan) on keybase.
  • I have a public key whose fingerprint is 19AC C373 719B 2FD0 A78C 9195 B26E 748F 892E 858E

To claim this, I am signing this object:

@schell
schell / spec.hs
Created September 1, 2018 18:18
read from ag handle - ran with `stack test :target`
-- | The `ag` search process.
agSearchProcess :: Maybe FilePath -> CreateProcess
agSearchProcess mdir = ag { std_out = CreatePipe
, std_err = CreatePipe
, cwd = mdir
}
where ag = proc "ag" ["--noheading", "TODO"]
main :: IO ()
@schell
schell / haskell-games.md
Last active October 1, 2018 21:28
haskellgames.com

what is it

The idea is to host haskell implementations of popular console/arcade titles as a blog series. The end goal being to ignite interest in writing games with haskell and possibly hosting a haskell game jam at some point in the future. For launch it would be nice to have 3-4 games already written.

Getting this off the ground is going to take a long time as my (schell's) free time is pretty limited ATM, so don't worry if you feel like committing to this is too much. You can commit any amount of time and write your game slowly as I figure out the details.

@schell
schell / typograffiti.hs
Created October 11, 2018 20:07
things to do with typograffiti
-- It would be nice to introduce more layout options. Something like annotated text
-- in iOS/UIKit.
-- | This is how Sandy uses cairo/pango.
-- https://github.com/isovector/sequoia/blob/master/src/Game/Sequoia.hs#L262-L284
renderElement :: Engine -> Element -> Cairo.Render ()
renderElement _ (TextElement (Text { textColor = (Color r g b a), .. })) = do
Cairo.save
layout <- Pango.createLayout textUTF8
@schell
schell / KindMVC.hs
Created April 19, 2019 00:28
THC inspired HKDs
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module Lib
( someFunc
) where
@schell
schell / .spacemacs
Created September 6, 2019 19:44
.spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@schell
schell / syntax_macro.rs
Last active October 16, 2019 20:07
lots of derivations
#[macro_export]
macro_rules! syntax_for {
( $x:expr ) => {
impl From<$x> for Expression<$x> {
fn from(v: $x) -> Expression<$x> {
Expression::from_term(Term::new(v, 1.0))
}
}
impl Add<f64> for $x {
@schell
schell / release_asset.sh
Created January 24, 2020 19:44
bash script to create releases with upload asset
#! /bin/bash
# requires curl and jq on PATH: https://stedolan.github.io/jq/
# create a new release
# user: user's name
# repo: the repo's name
# token: github api user token
# tag: name of the tag pushed
create_release() {
user=$1
@schell
schell / HH_contract_2.md
Last active May 11, 2020 20:18
HH sensor circuit #2 contract description

HH task #2 Contract

This is the decscription of a task that requires some EE skills.

description

The task in question is to create and test (by breadboarding) a circuit that uses a [small, through-hole photointerrupter][sensor] that can be reliably read by a raspberry pi GPIO input pin (3.3v). The purpose of the circuit is to detect when an object (like a sheet of paper) passes through the photointerrupter by reading a boolean on/off signal. The circuit should be prioritized for low-power use and polling speed, if possible.