Skip to content

Instantly share code, notes, and snippets.

View shmam's full-sized avatar
☀️
trying to spend less time on the computer and more time outside

Sam Crochet shmam

☀️
trying to spend less time on the computer and more time outside
View GitHub Profile
@shmam
shmam / DragGestureTest.swift
Created January 2, 2024 15:12
Drag Gesture Question
import SwiftUI
struct TestCanvas: View {
@State private var currentGestureLocation: CGPoint = .zero
let colors = [
Color.gray,
Color.gray,
Color.gray,
Color.gray
{
"response_code": 200,
"count": 1,
"cards": [
{
"title": "Lost In Yesterday",
"title_url": "https://open.spotify.com/track/3eoNUm0LU9hATVVi9w4fM6?si=t-s7qM7wRfWT12QlhugowQ",
"subtitle": "Tame Impala - The Slow Rush",
"time": "2020-07-14T16:45:37Z",
"images": {
@shmam
shmam / readme.txt
Created April 13, 2020 17:56
Lost in my Head (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@shmam
shmam / readme.txt
Created March 24, 2020 21:22
Simple Block Pushing Game (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@shmam
shmam / spam.C
Last active May 4, 2018 10:04
Simple exploit of the dangerous stdlib.h system() function in C99 to make a replicating and auto-compiling program. I haven't run the full thing yet because it is probably bad. I really have to study now but I plan on updating this and adding to it after my exam.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
system(" rm -f spam2.c spam2.o spam2");
system(" touch spam2.c");
system(" hexdump -ve \'1/1 \"%.2x\"\' spam.c | xxd -r -p > spam2.c");
system(" gcc -Wall -std=c99 spam2.c -o spam2");
system(" echo STOP ME :) ");
@shmam
shmam / Graph.java
Last active December 22, 2017 18:05
Since undirected graphs are really interesting structures I decided to practice my data structures skills by implementing it in Java. Vertices are stores in a SortedArrayList which was made in one of my course assignments. Binary search is used to find a vertex in the set, reducing the worst case runtime efficiency of adding a new vertex with a …
package util;
import java.util.*;
import javax.xml.crypto.*;
public class Graph<E extends Comparable<E>> {
private SortedArrayList<Vertex<E>> vertexSet;
public Graph() {
this.vertexSet = new SortedArrayList<Vertex<E>>();
@shmam
shmam / app.py
Last active July 31, 2017 15:13
Flask Color Change code for RPI3 Python API Server
#!flask/bin/python
import time, sys
import RPi.GPIO as GPIO
from flask import Flask
redPin = 11 #Set to appropriate GPIO
greenPin = 15 #Should be set in the
bluePin = 22 #GPIO.BOARD format
app = Flask(__name__)