Skip to content

Instantly share code, notes, and snippets.

View samwightt's full-sized avatar

Sam Wight samwightt

View GitHub Profile
@samwightt
samwightt / main.sh
Created May 22, 2018 21:52
Script to organize files based on their creation dates in Hazel. Can be wrapped in a for loop to target multiple files outside of Hazel.
# $1 is the path to the file that you want to move. This is automatically set in Hazel on Mac.
# If you're not using this with Hazel, uncomment the line below and set the file's direct path.
# 1=file/path/here
# If you're using this with a different type other than pdfs, change all occurences of *.pdf in the file to *.ext,
# where .ext is the extension of the file type you are targeting.
# Variable to store directory structure.
date=`date -r "$1" +%Y/%b/%d`
@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) {

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:

include <iostream>
using namespace std;
struct thing {
int i;
string j;
}
int main(void) {
thing a = new thing;
@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};
@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 / 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;
Verifying my Blockstack ID is secured with the address 1EhhD4U6HTVJ5vFzvL5MnF5rstuZj5RfUu https://explorer.blockstack.org/address/1EhhD4U6HTVJ5vFzvL5MnF5rstuZj5RfUu

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:

<!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>