Skip to content

Instantly share code, notes, and snippets.

View tjarratt's full-sized avatar

Tim Jarratt tjarratt

View GitHub Profile
@tjarratt
tjarratt / linked_list.py
Created July 24, 2023 22:04
Basic Python Linked List
class Node:
def __init__(self, val):
self.__value = val
self.__next = None
def add(self, next_):
self.__next = next_
def value(self):
return self.__value
@tjarratt
tjarratt / more_complete_set.py
Created July 19, 2023 17:38
A set that can be iterated and knows its size
class ListSet:
def __init__(self):
self._values = []
self.__index = 0
def add(self, value):
if value in self._values:
return
self._values.append(value)
@tjarratt
tjarratt / iterable_set.py
Created July 19, 2023 15:06
A set that can be iterated
class ListSet:
def __init__(self):
self._values = []
self.__index = 0
def add(self, value):
if value in self._values:
return
self._values.append(value)
@tjarratt
tjarratt / basic_set.py
Last active July 19, 2023 15:06
Basic set implementation in python
class ListSet:
def __init__(self):
self._values = []
self.__index = 0
def add(self, value):
if value in self._values:
return
self._values.append(value)
---
credentials:
- name: /concourse/main/credhub-server
type: value
value: <REPLACE-ME>
- name: /concourse/main/credhub-client
type: value
value: credhub_admin
- name: /concourse/main/credhub-secret
type: password
@tjarratt
tjarratt / vim.rc
Created November 9, 2020 15:18
example of a minimal yet just-good-enough vimrc
set number
set linebreak
set showbreak=+++
set textwidth=100
set showmatch
set visualbell
set hlsearch
set smartcase
set ignorecase
@tjarratt
tjarratt / references.txt
Created July 3, 2019 14:25
References pour mon talk "Apprenssage Continu"
The Design of Everyday Things - https://www.amazon.fr/Design-Everyday-Things-Revised-Expanded/dp/0465050654
The Fifth Discipline -- https://www.amazon.fr/Fifth-Discipline-Practice-Learning-Organization/dp/0385517254
Zen and the Art of Motorcycle Maintenance -- https://www.amazon.fr/Zen-Art-Motorcycle-Maintenance-Inquiry/dp/0060589469
Rich Hickey -- Hammock Driven Development -- https://www.youtube.com/watch?v=f84n5oFoZBc
@tjarratt
tjarratt / scalar-replacement-of-aggregates.txt
Created June 21, 2019 12:11
Extract from "Introduction to Program Optimizers"
Scalar Replacement of Aggregates
================================
Scalar replacement of aggregates makes other optimizations applicable to components of aggregates, such as C structures and Pascal records. It is a simple and effective optimization. It checks which components of the aggregate are simple scalars, and if they are not aliased (neither the components nor the whole aggregate), they are assigned to temporaries of the appropriate type. These temporaries become available to many optimizations.
The following example demonstrates how scalar replacement of Aggregates help other optimizations:
typedef enum { APPLE, BANANA, ORANGE } VARIETY;
typedef enum { LONG, ROUND } SHAPE;
typedef struct fruit {
VARIETY variety;
@tjarratt
tjarratt / example.sh
Last active May 24, 2019 16:51
Steps for inserting into pal-tracker history (rewriting history)
#!/usr/bin/env bash
echo 'this will CERTAINLY not work without further modifications'
echo 'Dont even think about it'
exit 1
echo 'make the changes you want to make'
git checkout solution
git lola
@tjarratt
tjarratt / notes.txt
Created January 29, 2018 09:39
Notes from Rich Hickey's talk on "Effective Programs"
effective programs - rich hickey
"if 100 people use this, it will be outrageous"
a look back at motivations behind clojure
takes time to understand what and why and what you were thinking
hot take : there was NO grand plan for clojure - it involved the community
clojure is opinionated "wow, this is forcing me, at every turn, to do something a certain way"
only a few strongly supported idioms, with a lot of support for them...
design is all about making choices
in clojure there was a big choice about what to leave out