Skip to content

Instantly share code, notes, and snippets.

View amandaroos's full-sized avatar

Amanda Roos amandaroos

View GitHub Profile
Toast toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
toast.show();
@amandaroos
amandaroos / translations.xlsm
Last active December 4, 2018 18:57
Takes in a list of language codes and a phrase to be translated through a google translate URL
'WARNING: Will open as many browser tabs as the length of the array, so it could take a while to load
'ShellExecute code from https://stackoverflow.com/questions/3166265/open-an-html-page-in-default-browser-with-vba
'Dynamic Array code from https://www.thespreadsheetguru.com/blog/dynamically-populating-array-vba-variables
Option Explicit
Private Declare Function ShellExecute _
Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hWnd As Long, _
@amandaroos
amandaroos / break.py
Created November 8, 2018 03:55
Take a Break - Python
import time
import webbrowser
numberOfBreaks = 2
seconds = 1
while numberOfBreaks > 0:
time.sleep(seconds)
webbrowser.open("www.youtube.com")
numberOfBreaks -= 1
@amandaroos
amandaroos / rename_files.py
Created November 8, 2018 03:50
Renaming Files - Python
import os
def rename_files():
#get file names from a folder
file_list = os.listdir(r"C:\")
print(file_list)
#get current working directory
saved_path = os.getcwd()
#change directory
os.chdir(r"C:\")
@amandaroos
amandaroos / DrawOnSenseHatWithJoystick.py
Created May 26, 2017 06:55
Using the SenseHat joystick to manipulate pixels in the LED matrix
#For use with Rasp Pi SenseHat
from sense_hat import SenseHat, ACTION_PRESSED, ACTION_HELD, ACTION_RELEASED
from signal import pause
sense = SenseHat()
sense.clear()
#Where is the cursor starting point?
x = 2
@amandaroos
amandaroos / CounterApp.java
Last active March 25, 2017 21:02
Code for creating a simple Android counter app
//Xml code for creating the count TextView
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textSize="120sp"
android:id="@+id/count"
android:text="0" />
//Java code for increasing the count and displaying it