Skip to content

Instantly share code, notes, and snippets.

@trevren11
trevren11 / timer.java
Last active April 2, 2017 03:49
Android Timer method
// I use this often enough to write down somewhere
new CountDownTimer(2000,1000){
public void onTick(long millisUntilFinished){}
public void onFinish(){}
}.start();
@trevren11
trevren11 / settings.json
Created March 24, 2017 03:53
Settings for Visual Studio Code
// Place your settings in this file to overwrite the default settings
{
"editor.acceptSuggestionOnEnter": false,
"typescript.check.tscVersion": false,
"files.autoSave": "afterDelay",
"editor.minimap.enabled" : true
}
@trevren11
trevren11 / RandomGameName.java
Created February 24, 2017 22:15
Generate a random game name in Java
package cs340.tickettoride.shared.utils;
import java.util.Random;
public class RandomGameName {
private static String[] Beginning = {"Busy",
"Lazy",
"Careless",
"Clumsy",
@trevren11
trevren11 / GeneragePersonName.java
Created February 24, 2017 22:14
Generate a Random person name in Java
package cs340.tickettoride.shared.utils;
import java.util.Random;
/**
* Created by trevr on 2/24/2017.
*/
public class GeneragePersonName {
package Server;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
@trevren11
trevren11 / SHA.sh
Last active April 20, 2017 04:22
Make a SHA-1 key for Android in Windows
# Location of the bin where you need to execute the tool
cd C:\Program Files\Java\jdk1.8.0_91\bin
# This makes a file auth
keytool -genkey -alias authTest -keystore C:\Users\trevr_000\.keystore\auth
# This shows the keys needed to authenticate with Firebase
keytool -exportcert -list -v -alias authTest -keystore C:\Users\trevr_000\.keystore\auth
# Make a debug key
@trevren11
trevren11 / .aliai.sh
Last active October 19, 2017 00:54
My Bash Profile
#Alias/shortcut commands
cyan "Importing Aliases"
alias src="source ~/.bash_profile"
alias sre="$EDITOR ~/.bash_profile"
alias sra="$EDITOR ~/.aliai"
alias srv="$EDITOR ~/.variables.sh"
alias srf="$EDITOR ~/.functions.sh"
#TODO make an alias to amend to bash profile so it is easier to add
#alias amd=""
@trevren11
trevren11 / runAll.sh
Last active March 22, 2016 02:25
Example of compiling c++ lab 236 BYU
#!/bin/bash
#compile and run tests and check with valgrind afterwards
RED='\033[0;31m'
Blue='\033[0;36m'
NC='\033[0m' # No Color
#Black 0;30 Dark Gray 1;30
#Red 0;31 Light Red 1;31
#Green 0;32 Light Green 1;32
#Brown/Orange 0;33 Yellow 1;33