Skip to content

Instantly share code, notes, and snippets.

View DavidJRobertson's full-sized avatar

David Robertson DavidJRobertson

View GitHub Profile
@DavidJRobertson
DavidJRobertson / spi_ninebit_test_main.c
Created March 9, 2022 01:59
Example of workaround for 9-bit SPI data corruption on ESP32-S3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/spi_master.h"
#include "driver/gpio.h"
#include "sdkconfig.h"
#include "esp_log.h"
@DavidJRobertson
DavidJRobertson / spi_ninebit_test_main.c
Created March 5, 2022 01:26
Example to reproduce 9-bit spi data corruption on ESP32-S3
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/spi_master.h"
#include "driver/gpio.h"
#include "sdkconfig.h"
#include "esp_log.h"
@DavidJRobertson
DavidJRobertson / chemical-property-dedup.xsl
Created November 30, 2020 00:14
Pubchem LCSS data mangling
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
<xsl:template match="/">
<Chemicals>
<xsl:apply-templates/>
</Chemicals>
// This file is automatically compiled by Webpack, along with any other files
// present in this directory. You're encouraged to place your actual application logic in
// a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled.
require("@rails/ujs").start()
require("turbolinks").start()
require("@rails/activestorage").start()
require("channels")
'NATASHA'S (TASHOLOGY) MYSQL SAVING SYSTEM!
'CHANGE THIS TO YOUR SETTINGS
Dim conn As String = "Server=epsilon.davidr.me;Database=tashdb;Uid=tashdb;Pwd=nLEYmTSYEQZzN483;"
Dim connect As MySqlConnection
Try
'Create the connector
connect = New MySqlConnection(conn)
'Open the database
@DavidJRobertson
DavidJRobertson / rtfm.h
Created October 20, 2016 15:42
GCC- error if not using c99
#if __STDC_VERSION__ < 199001L
#error DEAR MARKER: This program must be compiled in C99 mode - see instructions in report (-std=c99)
#endif
# David Robertson
# CS1P Lab Exam 2
import string, operator
def get_books(filename='books.txt'):
books_file = open(filename, 'r')
books_file_lines = books_file.readlines()
books_file.close()
;-----------------------------------------------------------------------
; Sigma16 Program BarChart
;
; CS1Q Systems Exercise 1
; David Robertson 2133246R TU02/LB02
; 18 February 2015
;-----------------------------------------------------------------------
; Status Report
import Canvas
import string
import re
def pos_cmd(state, x, y):
state['pos'] = [int(x), int(y)]
def move_cmd(state, x, y):
pos = state['pos']
@DavidJRobertson
DavidJRobertson / cgol.rb
Last active August 29, 2015 13:58
Simple implementation of Conway's Game of Life
#! /usr/bin/env ruby
module LiveCell
def self.to_s
'o'
end
def self.next_generation(neighbours)
case neighbours.count(LiveCell)
when 2..3 then LiveCell