Skip to content

Instantly share code, notes, and snippets.

View drewcassidy's full-sized avatar

Andrew Cassidy drewcassidy

View GitHub Profile
@drewcassidy
drewcassidy / Deque.cs
Last active May 8, 2017 03:25
A Deque class written in C#. has no external dependencies!
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace Voxelgon.Collections {
public class Deque<T> : ICollection<T> {
#region Fields

Keybase proof

I hereby claim:

  • I am drewcassidy on github.
  • I am drewcassidy (https://keybase.io/drewcassidy) on keybase.
  • I have a public key whose fingerprint is 4B68 3A9B 53E5 EC6B 5C2F B8F7 774E CFF4 464A C5CD

To claim this, I am signing this object:

@drewcassidy
drewcassidy / BinarySearch.java
Last active June 8, 2017 20:58
stupid binary search for my AP Computer Science class in High School
public class BinarySearch {
public int find(int[] arr, int v) {
int i = 0;
int b = (1 << (Double.doubleToLongBits(arr.length - 1) >> 51));
while ((b >>>= 1) > 0) {
if ((i | b) < arr.length && arr[i | b] <= v) i |= b;
if (arr[i] == v) return i;
}
@drewcassidy
drewcassidy / Doxyfile
Last active October 7, 2016 22:17
mbed-drivers doxygen
# Doxyfile 1.8.8
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a double hash (##) is considered a comment and is placed in
# front of the TAG it is preceding.
#
# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
@drewcassidy
drewcassidy / gen.py
Last active September 18, 2016 00:17
import os
dest = open("source/bitmaps.cpp", "w+")
head = open("source/bitmaps.h", "w+")
dest.write("#include \"bitmaps.h\"\n")
head.write("#ifndef BITMAPS_H\n#define BITMAPS_H\n")
for file in os.listdir("bitmaps"):
if file != ".DS_Store":
size = os.stat("bitmaps/" + file).st_size
@drewcassidy
drewcassidy / 16-04-20
Last active April 21, 2016 00:01
3D printer M501 logs
echo:Stored settings retrieved
echo:Steps per unit:
echo: M92 X75.33 Y79.29 Z2020.00 E98.00
echo:Maximum feedrates (mm/s):
echo: M203 X125.00 Y125.00 Z5.00 E14.00
echo:Maximum Acceleration (mm/s2):
echo: M201 X2000 Y2000 Z30 E10000
echo:Acceleration: S=acceleration, T=retract acceleration
echo: M204 S3000.00 T3000.00
echo:Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)
@drewcassidy
drewcassidy / setbrightness
Created April 18, 2016 02:25
bash script to set the raspberry pi 7" LCD backlight. takes 1 argument from 0 to 255. place in /usr/bin
#!/bin/bash
echo $1 > /sys/class/backlight/rpi_backlight/brightness
<?xml version="1.0" encoding="utf-8"?>
<!--This file represents the results of running a test suite-->
<test-results name="Unity Tests" total="3" errors="0" failures="1" not-run="0" inconclusive="0" ignored="0" skipped="0" invalid="0" date="2015-12-14" time="21:51:12">
<environment nunit-version="2.6.2-Unity" clr-version="2.0.50727.1433" os-version="Unix 15.2.0.0" platform="Unix" cwd="/Users/drewcassidy/Documents/Github/voxelgon" machine-name="Andrews-MacBook-Pro.local" user="root" user-domain="Andrews-MacBook-Pro.local" unity-version="5.3.0f4" unity-platform="Editor" />
<culture-info current-culture="en-US" current-uiculture="en-US" />
<test-suite name="voxelgon" type="Assembly" executed="True" result="Failure" success="False" time="0.064">
<results>
<test-case name="Voxelgon.MeshBuilder.Tests.MeshBuilderTests.TriangleContains" executed="True" result="Success" success="True" time="0.035">
</test-case>
<test-case name="Voxelgon.MeshBuilder.Tests.MeshBuilderTests.WindingOrder" execu
using System.Collections.Generic;
using System.Reflection;
namespace UnityEngine.EventSystems
{
[AddComponentMenu("Event/Standalone Input Module")]
public class StandaloneInputModule : PointerInputModule
{
private float m_NextAction;
@drewcassidy
drewcassidy / aBot
Last active August 29, 2015 14:25
fun with the Voight Kampff test
(] is a bot)
<cinebox>karkat: You’re in a desert walking along in the sand when all of the sudden you look down, and you see a tortoise, it’s crawling toward you. You reach down, you flip the tortoise over on it's back. The tortoise lays on it's back, it's belly baking in the hot sun, beating it's legs trying to turn it'self over, but it can’t, not without your help. But you’re not helping. Why is that?
<]>THE FASHION 4CHAN BOARD
<cinebox>oh
<cinebox>ok