Skip to content

Instantly share code, notes, and snippets.

import sys
#read Brainfuck from file and filter
filename = sys.argv[1]
with open(filename) as f:
bf = f.read()
legal = set('><+-.,[]')
bf = ''.join(c for c in bf if c in legal)
#!/bin/bash
git --work-tree=/var/notesworking --git-dir=/var/notes checkout -f
changed=$(git diff-tree -r HEAD | sed 's/^.*\s[A-Z]\s\s*//g' | sed 1d)
for filename in $changed
do
echo $filename
filetype=$(echo $filename | sed 's/.*\.//g')
if [ $filetype == "md" ]
then
@kdelwat
kdelwat / gist:d91fcc2388d24a627671ff68288210f1
Created December 29, 2016 00:16
Privacy policy for CadelTest
No-one else should be using this, but if you are, no personal information will ever be retained or used.
@kdelwat
kdelwat / secrets.pyi
Created January 3, 2017 02:34
Stubs for Secrets
# Stubs for secrets (Python 3.6)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from hmac import compare_digest as compare_digest
from random import SystemRandom as SystemRandom
randbits = ... # type: Any
choice = ... # type: Any
@kdelwat
kdelwat / gist:aab3f4fa509ca070a7bc0ba21c9b543a
Created January 12, 2017 07:22
Privacy Policy - Momentum
Last updated: 12th January, 2017
This document outlines the privacy policy for the Momentum app. Momentum is bound by the Australian Privacy Act 1988 (Cth).
Collection of personal information
==================================
Momentum collects personal information local to your device for the purposes of fulfilling its purpose. It does not store personally identifying information except for user-inputted content.
Sharing of personal information
@kdelwat
kdelwat / controls.js
Created July 13, 2017 23:10
Touch controls for Code Camp World
var mouseDeadZone = 50;
if (this.game.getMouseX() > this.getXPosition() + mouseDeadZone)
{
this.setXSpeed(100);
this.setYSpeed(0);
this.playAnimation('Right');
}
else if (this.game.getMouseX() < this.getXPosition() - mouseDeadZone)
{
this.setXSpeed(-100);
#include <stdio.h>
#include <stdlib.h>
struct node {
int data;
struct node *next;
};
struct node *new_node(int data, struct node *next);
void print_list(struct node *head);
@kdelwat
kdelwat / List.c
Created October 10, 2017 21:09
COMP1511 list example
#include <stdio.h>
#include <stdlib.h>
#include "List.h"
List makeList(void) {
List l = calloc(1, sizeof(list));
return l;
}
List addAtHead(List l, int value) {
#! /bin/bash
make
./vmsim lru 5 4 < trace1 > my-out-lru-5-4-trace1.txt
diff my-out-lru-5-4-trace1.txt out-lru-5-4-trace1.txt
./vmsim fifo 5 4 < trace1 > my-out-fifo-5-4-trace1.txt
diff my-out-fifo-5-4-trace1.txt out-fifo-5-4-trace1.txt
./vmsim lru 8 4 < trace2 > my-out-lru-8-4-trace2.txt
import Web3 from "web3";
import { getWeb3 } from "./utils/web3";
const Contract = require("truffle-contract");
import * as SaleABI from "../../build/contracts/YabbySale.json";
import * as CoinABI from "../../build/contracts/YabbyCoin.json";
function showWeb3(divName: string, web3: Web3) {
const elt = document.getElementById(divName);