Skip to content

Instantly share code, notes, and snippets.

View justgage's full-sized avatar

Gage Peterson justgage

View GitHub Profile
@justgage
justgage / git-instructions.md
Last active January 2, 2016 21:59
How to use Git on BYU-I's servers

step 1: do the normal setup with git adding a SSH key to git NOTE: the ssh test they have will FAIL! This is ok.

step 2: make a repo (or use one you already have)

step 3: go to the repo and find the clone link FOR HTTPS.

step 4: add this to your ~/.bashrc (use emacs or vim to edit that file, add it if it doesn't exist) -> unset SSH_ASKPASS

step 5: Edit the link adding username@ to the in front of the github.com

@justgage
justgage / byui_android_setup.md
Last active February 24, 2021 05:18
How to set up BYU-I Email on an Android phone.

#How to set up BYU-I Email on an Android phone.

Step1: Enter your "Email" app on you phone

Step2: take your username from byui and tack a @byui.edu on the end for your username.

Step3: Enter your normal password and hit "manual setup"

Step4: Choose IMAP

@justgage
justgage / Opinionated.java
Last active August 29, 2015 14:00
Opinionated.java
class Opinionated {
public static void main(String[] args) {
int i = 0;
if (args.length > 0) {
for(String arg:args) {
i++;
System.out.print(i + ": " + arg);
@justgage
justgage / serialize
Created May 2, 2014 06:04
A simple example of writing a java object to a file.
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
class wallet implements java.io.Serializable {
private double balence;
public double check() {
@justgage
justgage / Wallet.java
Created May 3, 2014 01:50
A simple program to keep track of money in various wallets.
This is a simple program that will keep track of how much money you have in various "Wallets".
-----------------------------------------
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.PrintWriter;
@justgage
justgage / wallet.2.java
Created May 4, 2014 08:14
Wallet version 2
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
class Transaction {
@justgage
justgage / wallet3.java
Created May 6, 2014 06:17
wallet3.java
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
class Transaction {
@justgage
justgage / wallet4.java
Created May 7, 2014 06:23
An even more improved wallet!
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@justgage
justgage / makeItJustChecked.js
Created November 19, 2014 03:10
A Bookmarklet to check all the boxes on I-learn.
javascript:(function(){var checkboxes=$("iframe").contents().find("iframe").contents().find(".radio");checkboxes.each(function(){this.checked=true});})();
@justgage
justgage / anagram.clj
Last active August 29, 2015 14:19
Anagram challenge in clojure
;; This is is a chalenge I did for hacker rank
;; enjoy,
;; ~ Gage
(defn first-half "gets the first half of a string"
[input]
(subs input 0 (/ (count input) 2)))
(defn second-half "gets the second half of the string"
[input]