Skip to content

Instantly share code, notes, and snippets.

View dvtate's full-sized avatar
🐧
chilling

Dustin Van Tate Testa dvtate

🐧
chilling
View GitHub Profile
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
unsigned long long int numLaughs = 0;
void normalExit(void){
printf("\nI laughed %llu times、\n\n", numLaughs);
@dvtate
dvtate / HexToRGB.cpp
Last active November 7, 2016 06:43
converts a string representing a hex number into 8-bit RGB values
#include <iostream>
#include <stdint.h>
#include <string.h>
// this solution is dependent on endianess, and is thus not cross-platform
struct RGB_t {
#include <iostream>
#pragma pack(0)
// a 4-bit bitfield
struct word_t {
unsigned int val : 4;
};
// 8-bits
@dvtate
dvtate / terminal_colors_test.cpp
Last active March 31, 2017 06:30
a simple test of ansi color codes for modern terminal emulators
#include <stdio.h>
#include <inttypes.h>
#include <stdarg.h>
#define COLOR_RESET "\x1B[0m"
inline void textColor()
import tkinter as tk;
import random;
class Application(tk.Frame):
def __init__(self, master = None):
tk.Frame.__init__(self, master);
self.grid();
self.createWidgets();
@dvtate
dvtate / lamp.pov
Last active July 6, 2016 20:06
a lamp on a tiled floor in a dark environment
#version 3.7
global_settings{ assumed_gamma 1.0 }
#default{ finish{ ambient 0.1 diffuse 0.9 }}
#include "colors.inc"
#include "glass.inc"
/*
light_source {
<50, 20, 10>
color White
@dvtate
dvtate / snake.py
Last active October 12, 2016 03:45
follows the mouse..
import tkinter as tk;
import random;
import time;
WIDTH = HEIGHT = 800;
POPULATION = 200;
# returns a hex color between #000 and #FFF in the form of a string
@dvtate
dvtate / game_timer.ino
Last active March 31, 2017 06:32
a game timer/buzzer I made for GHP engineering's saturday build challenge.
#include "Arduino.h"
#include <inttypes.h>
#define BUTTON_PIN 4
#define BUZZ_PIN 5
#define RED_LED_PIN 8
#define GREEN_LED_PIN 9
@dvtate
dvtate / dice.pov
Last active July 4, 2016 19:55
A die I made for POVRay :)
#version 3.7
global_settings{ assumed_gamma 1.0 }
#default{ finish{ ambient 0.1 diffuse 0.9 }}
#include "colors.inc"
light_source {
<50, 20, 10>
color White
@dvtate
dvtate / linked list.py
Last active March 31, 2017 06:34
It's so weird doing this in python...
class Node(object):
def __init__(self):
self.data = None;
self.next = None;
self.prev = None;
def __init__(self):
self.data = None;
self.next = None;
self.prev = None;