Skip to content

Instantly share code, notes, and snippets.

View claraj's full-sized avatar

Clara claraj

  • Minneapolis College
  • Minneapolis, MN
View GitHub Profile
## Reclassify and polygonize (convert to shapefile) pvm_rf.tif
setwd("location/of/your/files/here")
pvm_rf_raster <- raster('pvm_rf.img')
# Calculate the min and max values of cells in the raster. For this, -2.020606e-16, 1
# This is a raster of probabilities so would be expected to be 0 and 1 but floating point math
# often has inaccuracies of this magnitude.
setMinMax(pvm_rf_raster)
@claraj
claraj / formatted_with_suggested_zoom.json
Last active April 7, 2019 02:50
Geographic centers of each US state
[
{
"name":"Alabama",
"lat":32.7794,
"lon":-86.8287,
"zoom":5
},
{
"name":"Alaska",
"lat":64.0685,
package week_7.ticket;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
public class ExampleFileAppend {
public static void main(String[] args) {
streets = ['11th', 'Grand', 'Hennepin']
print('Hennepin' in streets)
if 'Hennepin' in streets:
print('Hennepin is one of the streets ')
print(streets)
streets3 = streets * 3
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="https://unpkg.com/[email protected]/dist/vue.js"></script>
</head>
<body>
<div id="app">
small_num = int(input('enter the small number '))
large_num = int(input('enter the large number '))
total = 0
for number in range(small_num, large_num + 1):
print(number)
total = total + number
print(f'the total is {total}')
@claraj
claraj / java-cmd.md
Last active July 30, 2024 07:16
Running Java code from the command line

Plain Java Project (not Maven, no GUI, no dependencies)

Assuming files are in /src/com/clara/ and main method is in Main.java

compile with javac src/com/clara/*.java or for Windows users java src\com\clara\*.java

execute with java -cp ./src com.clara.Main or for Windows users java -cp src com.clara.Main

The -cp flag sets the classpath, in effect, telling Java where to look for the code that makes up your project. More info: http://kevinboone.net/classpath.html/

# Download the latest ChromeDriver and put in the same place as this script. Or, in a location on your computer's path.
# http://chromedriver.chromium.org/
# Install Selenium with
# pip install selenium
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
@claraj
claraj / pre-commit
Created March 29, 2018 02:49
hacky git hook to prevent commits if app.yaml contains real password
#!/bin/sh
#
# Check the app.yaml and verify it uses the pretend password.
echo "this is a hook"
filename="app.yaml"
placeholder="db-password-here"
from book import Book # assume this exists, and Books have author and title fields
b1 = Book('jane Eyre', 'Charlotte Bronte', True, 1)
b2 = Book('The Handmaid\'s Tale', 'Margaret Atwood', True, 2)
b3 = Book('1984', 'George Orwell', True, 3)
booklist = [b1, b2, b2]
print(booklist)