Skip to content

Instantly share code, notes, and snippets.

View llllllllll's full-sized avatar

Joe Jevnik llllllllll

View GitHub Profile
sudo apt-get update
sudo apt-get install bluez bluez-utils scons git libbluetooth-dev
git clone https://github.com/llllllllll/C_NXT.git
cd C_NXT/src
scons
cp libc_nxt.a ../example
cd ../example
make
gpasswd -a crunchbang bluetooth
bluetooth-wizard # PIN = 1234
@llllllllll
llllllllll / example.hs
Last active August 29, 2015 13:59
Example code for: Introduction to Category Theory with Applications in Computer Science
{-# LANGUAGE NoImplicitPrelude,KindSignatures #-}
-- Joe Jevnik
-- 2014.4.12
-- Examples to go with my abstract algebra final paper.
-- | Lets hide the functions we will be writing ourselves.
import Prelude hiding (Functor,Monad,(>>=),return,fmap)
-- | Our haskell functor class.
#!/usr/bin/bash
AUR_DIR=$HOME/aur
SUFFIX=-no-hdri
print_usage(){
echo "Usage: $0 [-h|AUR-DIR]"
}
@llllllllll
llllllllll / namedtuple.c
Last active September 9, 2022 14:49
namedtuple.c
#include <ctype.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <Python.h>
#include <structmember.h>
#include <frameobject.h>
from itertools import chain
from types import FunctionType, BuiltinMethodType, BuiltinFunctionType
from codetransformer import Code, CodeTransformer
from codetransformer.instructions import (
CALL_FUNCTION,
DELETE_DEREF,
DELETE_GLOBAL,
DELETE_NAME,
JUMP_ABSOLUTE,
#include <stdio.h>
typedef int (*t)(int);
t f(int a) {
int g(int b) {
return a + b;
}
return g;
}
@llllllllll
llllllllll / a.py
Created December 14, 2015 22:41
quick nse with lazy
'''
Examples
--------
In [1]: a
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-60b725f10c9c> in <module>()
----> 1 a
@llllllllll
llllllllll / b.py
Last active December 14, 2015 23:15
"""
Example
-------
In [1]: from b import _t
In [2]: _t[1 ::]
File "<string>", line unknown
SyntaxError: type assertions must use 'a :: b' syntax

Keybase proof

I hereby claim:

  • I am llllllllll on github.
  • I am llllllllll (https://keybase.io/llllllllll) on keybase.
  • I have a public key ASC131rrl_GjKcDya5zfqv148745F886J8bS7ysaNnPJCAo

To claim this, I am signing this object:

#pragma once
#include <array>
#include <tuple>
#include <Python.h>
#include "utils.h"
namespace pyutils {