Skip to content

Instantly share code, notes, and snippets.

@freakinbook
freakinbook / deconstructNumber.js
Created Oct 25, 2021
Turn an input string into an array of ints
View deconstructNumber.js
function deconstructNumber(deconstructee) {
let numberAsArray = [];
let divisor = 10;
let index = 0;
let sign = "";
if (deconstructee.includes("-")) {
deconstructee = deconstructee.substring(1);
sign = "-";
}
if (deconstructee === "0") {
@russc
russc / Test 5
Created Oct 25, 2021
created from remix form!
@jhollist
jhollist / iterate_waters.R
Created Oct 25, 2021
Example code for using a dataframe to access USEPA WATERS API. Shows two iteration examples: purrr and for loop.
View iterate_waters.R
library(purrr)
library(jsonlite)
library(dplyr)
library(usethis)
# The Data.gov API requires a key and has a 1000 request/hour limit
# Get Key from https://api.data.gov/signup/
# Save key in r environ
usethis::edit_r_environ()
# Add DATAGOV_KEY=YOURKEYGOESHERE to the file. Save and restart R
View mars_rover.md

A squad of robotic rovers are to be landed by NASA on a plateau on Mars. This plateau, which is curiously rectangular, must be navigated by the rovers so that their on-board cameras can get a complete view of the surrounding terrain to send back to Earth.

A rover’s position and location is represented by a combination of x and y co-ordinates and a letter representing one of the four cardinal compass points (North, South, East, or West). The plateau is divided up into a grid to simplify navigation. An example position might be 0, 0, N, which means the rover is in the bottom left corner and facing North.

In order to control a rover, NASA sends a simple string of letters. The possible letters are ‘L’, ‘R’ and ‘M’. ‘L’ and ‘R’ makes the rover spin 90 degrees left or right respectively, without moving from its current spot. ‘M’ means move forward one grid point, and maintain the same heading.

Assume that the square directly North from (x, y) is (x, y+1). Assume that the square directly East from (x, y) is (x+1,

@Jeremywu0109
Jeremywu0109 / stack.cpp
Last active Oct 25, 2021
中序轉前序運算式
View stack.cpp
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
void inToPostfix(char*, char*);
int priority(char);
int main()
{
int max = 100, len = 0;
View grapql.md

grapql

{
  file(base: {}, relativePath: {eq: "palm-tree.jpg"}) {
    id
    base
    prettySize
    childImageSharp {
      id
      gatsbyImageData(
@firecrest-it
firecrest-it / civitanova_marche__33n_395___4797_-2005-10-28.geojson
Created Oct 25, 2021
Civitanova Marche [33N 395 / 4797], 2005-10-28
View civitanova_marche__33n_395___4797_-2005-10-28.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@firecrest-it
firecrest-it / civitanova_marche__33n_394___4797_-2005-10-08.geojson
Created Oct 25, 2021
Civitanova Marche [33N 394 / 4797], 2005-10-08
View civitanova_marche__33n_394___4797_-2005-10-08.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@firecrest-it
firecrest-it / civitanova_marche__33n_394___4797_-2005-09-20.geojson
Created Oct 25, 2021
Civitanova Marche [33N 394 / 4797], 2005-09-20
View civitanova_marche__33n_394___4797_-2005-09-20.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.