This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
A small script I wrote to manipulate Google Sheets. | |
What this script does: | |
1. Opens a spreadsheet with two worksheets | |
2. Lays out the data of the second worksheet in a dict (the keys are street addresses | |
and the items are arrays) | |
3. Fetches cell range to manipulate | |
4. Iterates through the rows in the first sheet and looks in the generated dict for a | |
match (same street address) | |
5. If found, inserts the array content into the row. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/python3 | |
''' | |
A little script that searches through folders for me and prints any files/dirs | |
that contain the query in the filename. | |
This is what happens when you don't really feel like going through the man of | |
the find command. | |
usage: | |
python3 find_query.py [query] [path] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require 2htdp/image) | |
(require 2htdp/universe) | |
(define (polygons n) | |
(let* ([random-color (lambda () (color (random 255) (random 255) (random 255)))] | |
[random-polygon (lambda (x) (star-polygon (* (add1 x) 30) (random 12 16) 11 'solid (random-color)))] | |
[polygons-list (build-list n random-polygon)] | |
[background (square (* 150 n) 'solid (random-color))]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require 2htdp/image) | |
(require 2htdp/universe) | |
;; structure used | |
(struct crcl (radius color)) | |
;; constants | |
(define SIZE 500) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
a simulation of the Monty hall problem | |
''' | |
from random import choice, sample | |
TRIALS = 10000 | |
def monty(): | |
''' | |
runs a simulation of the monty problem. this program will switch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[fontsize=11pt]{article} | |
\usepackage[english]{babel} | |
\usepackage[utf8]{inputenc} | |
\usepackage[T1]{fontenc} | |
\usepackage{lmodern} | |
\usepackage[protrusion=true,expansion=true]{microtype} | |
\usepackage[svgnames]{xcolor} % Colours by their 'svgnames' | |
\usepackage[margin=0.75in]{geometry} | |
\textheight=700px | |
\usepackage{url} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var folderName = "New Copy Center Jobs"; | |
var columnsToSkip = 2; | |
function createDocument(lastRow) { | |
const doc = createDoc(); | |
const sheet = SpreadsheetApp.getActiveSheet(); | |
const fullRangeValues = sheet.getDataRange().getValues(); | |
const titles = fullRangeValues[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
import re | |
from sys import argv | |
status = {"0": "Empty", "1": "Low", "2": "Normal", "3": "Full"} | |
data = { | |
"uri":"/rps/", | |
"userID":"", | |
"password":"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from xml.etree import ElementTree as ET | |
import requests | |
NAMECHEAP_URL = "https://api.namecheap.com/xml.response" | |
class NamecheapClient: | |
def __init__(self, api_key, api_user, user_name, client_ip): | |
self.api_key = api_key | |
self.api_user = api_user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios' | |
export async function findShortestPath(firstPage, secondPage, callback, parent) { | |
if (state === undefined) { | |
state = {} | |
state.done = false; | |
state.visited = {} | |
state.visited[firstPage] = true; | |
} |
OlderNewer