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
@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
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 / 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()
#include <iostream>
#pragma pack(0)
// a 4-bit bitfield
struct word_t {
unsigned int val : 4;
};
// 8-bits
@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 <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);
#include <iostream>
#include <string.h>
int main(int argc, char* args[]){
if (strcmp(args[1], "--version") == 0) {
std::cout <<"This is a ghetto echo function that reads in reverse.\n";
return 0;
} else if (strcmp(args[1], "--help") == 0) {
std::cout <<"Useage: echo [OPTION]... [STRING]...\n"
@dvtate
dvtate / challenge.cpp
Created February 1, 2017 04:07
the solution to the challenge faced by my friend Umar Faroq
#include <stdio.h>
#include <stdlib.h>
int main(){
// prompt:
printf("please enter a string:");
// get input
size_t linelen = 500;
@dvtate
dvtate / grip_launcher.bat
Last active March 12, 2017 08:28
people like to click on things.... Holy shit M$ batch sucks
@if "%DEBUG%" == "" @echo off
echo I had to make this to run the command for me...
echo Starting GRIP...
choice /c:ync /n /m "Run offline? (y/N/cancel)"
if errorlevel 3 exit
if errorlevel == 1 (
#ifndef COLOR_H
#define COLOR_H
#include <inttypes.h>
// 24-bit color class
class Color { // 16777216 colors
public:
// 24-bit color
uint8_t r, g, b;