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
# python -m pip install PyMuPDF Pillow | |
import os # for files and directories | |
import io # for bytes | |
import fitz #PyMuPDF | |
from PIL import Image #Pillow | |
for root, dirs, files in os.walk("."): | |
for filename in files: | |
if filename.endswith('.pdf'): |
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
// schedule this Google Apps Script function to run at a certain time to change a YouTube video's privacy status | |
function updateVideoPrivacy() { // enable the YouTube Data API under "Services" | |
var channels = YouTube.Channels.list('contentDetails', {mine: true}); | |
for (var i=0; i<channels.items.length; i++) { | |
var uploadsPlaylistId = channels.items[i].contentDetails.relatedPlaylists.uploads; | |
var playlistResponse = YouTube.PlaylistItems.list('snippet', {playlistId: uploadsPlaylistId, maxResults: 1}); // or more than 1 if needed | |
var video = playlistResponse.items[0]; // the first video in the list we retrieved | |
var metadata = { | |
status: {'privacyStatus': 'private'}, // public, unlisted, private | |
id: video.snippet.resourceId.videoId}; // we need to include the video ID from the playlist response |
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
function test() { | |
return "this works"; | |
} |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<link rel="icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAPD4/AC0vMADd3+AAWFpbAFlaWwC8vb0AOjw9AERHRwCSlJUAk5SVAJ6fnwD39/cAW1xeAGVnaAC0t7YAgYOEAI2OjgDk5uYA9fX1AFhaXABzdHUA5ubmAG5wcAA6PD4Ax8jIAEVHSAA2ODkAqaqqAPLz8wB7fX0AQ0VGADQ2NwB6e3sAs7W1AJqbnAAjJSYAi4yNAP7+/gDu7+8A7+/vAHZ5eQDf4OAAtbe4ANHR0QBPUFEAwsLCAKioqQCjpKQA/Pz8AO3t7QBrbG0AvcDAAExOTwDJy8oAlpeYAC4wMQDe4OEAkZOTAPr6+gBoamsAWVtcANzc3ABkZmYAKy4vAK6vrwAsLi8A/fz9AJCRkQDe3t8AZmhpANna2gDa2toAYmRkAJGTlADr6+wA9vb2AH6AgABlZmcAYGJiAMjJyQBGSEkAr6+wAIGCgwC3uLgAqKmpANTU1ABSU1QAqqusAEJERQC1trYAlpiYAC8xMQD///8AfX5/AH5+fwBtb3AA8PDwAODh4QB6enoAuLi5ALO0tAA8Pj4A/f39AHt8fQDu7u4Ad3h4AExPUADFxcYA0NDQAMDBwQBOT1AAPkBBAPn7+wDq7OwAeXp7ANvd3QDc3d0AdHZ2AEtNTgBMTU4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
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
// Teensy 2 Videoconference Buttons Controller | |
// Choose Keyboard from the "Tools > USB Type" menu | |
// buttons connected to 6 pins, and a switch for different programs | |
#include <Bounce.h> | |
Bounce button0 = Bounce(2, 50); | |
Bounce button1 = Bounce(1, 100); // this button was too sensitive | |
Bounce button2 = Bounce(0, 50); | |
Bounce button3 = Bounce(3, 50); | |
Bounce button4 = Bounce(14, 50); |
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
number_of_rounds = 50 | |
player1 = 'Steven' | |
player2 = 'Edward' | |
choices = { | |
'Steven':['Rock','Paper','Scissors'], | |
'Bart':['Rock'], | |
'Edward':['Scissors','Scissors','Scissors','Scissors','Paper','Paper'], | |
'Freddie':['Paper','Paper','Rock','Paper','Paper','Rock']} | |
# create a dataframe of rock beats scissors etc. |
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 os | |
import pdfplumber | |
from spellchecker import SpellChecker | |
spell = SpellChecker() | |
for path, directories, files in os.walk('.'): | |
for filename in files: | |
if filename.endswith('.pdf'): | |
filepath = path + os.sep + filename | |
student = path.split('- ')[1].strip() # get the student name from the directory name |
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 pandas as pd | |
import folium | |
from folium.plugins import MarkerCluster | |
df = pd.read_csv('https://drive.google.com/u/0/uc?id=1ptQoyoGhAv81R4A7VzupiYBhbBSD5uEy&export=download', low_memory=False) | |
m = folium.Map(location=[53.5,-114],zoom_start=5,prefer_canvas=True) | |
mc = MarkerCluster() | |
for row in df.itertuples(): | |
mc.add_child(folium.Marker(location=[row.Latitude,row.Longitude]))#, tooltip=row.Well_ID)) | |
m.add_child(mc) | |
m.save('water-well-map-alberta.html') |
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
#include <Adafruit_NeoPixel.h> | |
#define N_PIXELS 12 // Number of pixels you are using | |
#define LED_PIN 0 // NeoPixel LED strand is connected to GPIO #0 / D0 | |
Adafruit_NeoPixel strip = Adafruit_NeoPixel(N_PIXELS, LED_PIN, NEO_GRB + NEO_KHZ800); | |
void setup() { | |
strip.begin(); | |
strip.setBrightness(150); | |
white(); | |
} |
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
javascript:(function(){var url=location.href;if(url.includes('docs.google.com')){var urlc=url.substring(0,url.lastIndexOf('/'))+'/copy';window.prompt('Copy this URL',urlc);}else{window.alert('Run this on a Google Doc, Sheet, Slides, or Drawing');}})(); |