Skip to content

Instantly share code, notes, and snippets.

@gotcake
gotcake / Solution.java
Created April 17, 2020 19:03
Non-optimal solution for LeetCode Cat and Mouse problem
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.Stack;
import java.util.stream.IntStream;
class Solution {
static boolean DEBUG = false;
@gotcake
gotcake / example.sh
Last active April 5, 2020 04:34
Setup script for a mincraft server based on Ubuntu
wget -O minecraft_server_setup.sh https://gist.githubusercontent.com/gotcake/cf8d2c025c0e208a454368af181d4738/raw/1077e9494c0d17e5af4a6839e04b021f598dbee8/mincraft_server_setup.sh
bash minecraft_server_setup.sh
@gotcake
gotcake / keybase.md
Created November 17, 2019 19:03
Keybase verification

Keybase proof

I hereby claim:

  • I am gotcake on github.
  • I am gotcake (https://keybase.io/gotcake) on keybase.
  • I have a public key ASD9oOQeJD2RQeleD9AjQFdcsre_r_OPE3ZL_CUqRIfjaQo

To claim this, I am signing this object:

@echo off
REM Configuration Parameters
set domain=istlabs
set user_name=adc2619
set share=\\Zarek\Cylon
set mount_drive=Z:
set remote_vm_root=%mount_drive%\VM Images\Working
set local_vm_root=C:\Users\student\Desktop
REM there must not be spaces in these names!
@gotcake
gotcake / reference_counting.c
Created October 29, 2013 19:45
A small implementation of reference counting for C. Frees the programmer from keeping track of pointers and knowing when to free them when they are shared between multiple structures and functions.
#include "reference_counting.h"
#include <stdio.h>
#define NULL 0
// reference counting....
static struct m_ref {
void *ptr;
int count;
struct m_ref *next;
@gotcake
gotcake / try-remote
Created October 4, 2013 00:07
A script for remotely submitting things via RIT CS's try system, from your own computer. Set up SSH keys first.
#!/bin/bash
#
# This script allows remote submissions to try via scp uploads and remote ssh commands
#
# For this script to be effective, you should set up SSH to use
# key files instead of passwords. The steps are in the comments below.
# It will still work if you don't but you'll have to enter your password a bunch.
#
# $ ssh-keygen -t rsa # don't use a password here