Skip to content

Instantly share code, notes, and snippets.

View samwightt's full-sized avatar

Sam Wight samwightt

View GitHub Profile
@samwightt
samwightt / machine.js
Created April 26, 2021 17:45
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
<!DOCTYPE html>
<html>
<head>
<title>Flexbox CSS Centering Example</title>
</head>
<body>
<div id="parent-div">
<div id="child-div">
<h1>This is an example</h1>
</div>

Keybase proof

I hereby claim:

  • I am samwightt on github.
  • I am samwight (https://keybase.io/samwight) on keybase.
  • I have a public key ASAxWEa3p9ttSN7u22BWC0XEQ6A2BNUMXKtfwLlTVY1S8Qo

To claim this, I am signing this object:

Verifying my Blockstack ID is secured with the address 1EhhD4U6HTVJ5vFzvL5MnF5rstuZj5RfUu https://explorer.blockstack.org/address/1EhhD4U6HTVJ5vFzvL5MnF5rstuZj5RfUu
@samwightt
samwightt / builder.cpp
Last active April 15, 2019 22:32
Creates a random test file.
/* Generates a random text file using only characters from the keyboard.
Change the i variable for shorter or longer lengths. */
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
#include <ctime>
using namespace std;
@samwightt
samwightt / test1.cpp
Created March 20, 2019 18:38
A test file for project 3.
#include <iostream>
using namespace std;
#include "dList.cpp"
int main(){
const int size = 10;
float avgTime[size] = { 93, 99, 96, 97, 95,100, 94, 98, 92, 98};
float fuelEfficiency[size] = {194,201,196,156,193,100,194,198,200,140};
dList dl = dList(avgTime,fuelEfficiency,size);
@samwightt
samwightt / test.cpp
Last active March 4, 2019 19:36
Test file for project 2
#include <iostream>
using namespace std;
#include "dList.cpp"
int main(void) {
cout << "Test one:" << endl << endl;
float times[1] = {100};
float fuel[1] = {100};
include <iostream>
using namespace std;
struct thing {
int i;
string j;
}
int main(void) {
thing a = new thing;

Keybase proof

I hereby claim:

  • I am samuelwight on github.
  • I am samwightt (https://keybase.io/samwightt) on keybase.
  • I have a public key ASAzdrv5niFHHC66pUZLE7G1UJb9q8K2Vd8GokDRuN3gMgo

To claim this, I am signing this object:

@samwightt
samwightt / compare.c
Created November 8, 2018 23:18
Script to compare two pgm files to see if they are the same. Compile using: gcc -Wall compare.c. Run ./a.out to see usage.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define KRED "\x1B[31m"
#define KGRN "\x1B[32m"
#define KNRM "\x1B[0m"
int main(int argv, char **argc) {
if (argv != 3) {