Skip to content

Instantly share code, notes, and snippets.

@tsamb
tsamb / hls_2023_2024_courses.json
Created March 21, 2023 01:53
Structured data representing all Harvard Law School offered classes in the 2023-2024 academic year
This file has been truncated, but you can view the full file.
{ "hits": [ { "type": "hls_course", "title": "(Dis)illusionment for Young Lawyers", "url": "https://hls.harvard.edu/courses/disillusionment-for-young-lawyers-2/", "hls_course_academic_period": [ "2023-2024" ], "hls_course_delivery_mode": [ "Course" ], "hls_course_service_group": [ "Elective Course" ], "hls_course_term": [ "Fall 2023" ], "hls_interest_area": [ "Health, Food, and Drug Law", "Jurisprudence and Legal Theory", "Leadership", "Legal Profession and Ethics" ], "hls_instructor": [ "Richard Parker" ], "hls_course_day": [ "Tuesday" ], "course_offering_id": [ "80967" ], "course_id": [ "3170" ], "instructor_primary": [ "Richard Parker" ], "credits": [ 2 ], "day_time": [ "<span><span aria-label=\"Tuesday\">T</span></span> 1:30pm &ndash; 3:30pm" ], "faculty_id": [ "10648" ], "instructor_reverse": [ "Parker, Richard" ], "rooms": [], "schedule": [ "T 1:30pm - 3:30pm in " ], "weighting": 20, "hls_course_day_string": "Tuesday", "is_secure": null, "distinct_key": "hls_course-515191", "content": "Prerequisite: Non

Keybase proof

I hereby claim:

  • I am tsamb on github.
  • I am nuvotsamb (https://keybase.io/nuvotsamb) on keybase.
  • I have a public key ASDmxlDnuD_0nSxrAN1Xb0QMWiYiD6-hSqfk3CTHKoY5pQo

To claim this, I am signing this object:

function PRECIPITATION_YESTERDAY() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var rainfallSheet = ss.getSheetByName("Brooklyn daily rainfall");
var hourlyWeatherSheet = ss.getSheetByName("Brooklyn hourly weather");
// DEPENDENCY: Assumes worksheets exist with the above to names.
var endpoint = "https://api.openweathermap.org/data/2.5/onecall/timemachine";
var unixTimeYesterday = Math.floor((new Date((new Date).setDate(((new Date).getDate() - 1)))).valueOf() / 1000);
@tsamb
tsamb / airtable-record-activity-to-csv.js
Last active March 11, 2020 15:33
A dev console pasteable script for creating a CSV from the Airtable record history/activity panel
// In Airtable, expand a record and make sure its activity panel is expanded.
// Click "Show more" at the top of the activity panel until you get to the beginning of the record's history.
// Press Ctrl+Shift+J (on PC) or Cmd+Opt+J (on Mac) in your Chrome browser to pull up the JavaScript console.
// Paste the below script into the console to download the activity history as a CSV.
function arrayToCSV(nestedArray, exportName) {
const filename = exportName || "exported_js.csv";
const csvString = nestedArray.map((row) => row.map((field) => '\"' + field + '\"').join(',')).join('\r\n');
let a = document.createElement('a');
@tsamb
tsamb / imageswapper.js
Created July 8, 2016 00:05
Some code to paste into the console of webpages to change all of their images. (The website must have jQuery installed!)
// How do you create an prompt on the page then get an input of a search term
// Then replace all of the images with images based on that search term?
jQuery.getJSON(
"https://api.giphy.com/v1/gifs/search",
{q: "Ryan Gosling", api_key: "dc6zaTOxFJmzC"}
).done(function(response) {
var images = response.data.map(function(imgObj) {
return imgObj.images.original.url;
});
@tsamb
tsamb / glow.css
Created May 17, 2016 19:05
Css glow animation
.glowing-gold {
-webkit-animation: gold-glow 0.75s ease-in-out infinite alternate;
-moz-animation: gold-glow 0.75s ease-in-out infinite alternate;
animation: gold-glow 0.75s ease-in-out infinite alternate;
}
@-webkit-keyframes gold-glow {
from {
box-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff, 0 0 40px #FFDD1B, 0 0 70px #FFDD1B, 0 0 80px #FFDD1B, 0 0 100px #FFDD1B, 0 0 150px #FFDD1B;
}
@tsamb
tsamb / drag.html
Created June 17, 2015 12:50
Simple drag and drop in JavaScript
<html>
<head>
<title>drag and drop demo</title>
</head>
<body>
<div id="box" style="background-color:green;width:100px;height:100px; position:absolute; cursor:pointer"></div>
<script type="text/javascript">
// get and name the element
var box = document.getElementById("box");

DBC Hackathon working doc

@tsamb
tsamb / carousel.js
Created February 6, 2014 20:49 — forked from ksolo/carousel.js
Image Carousel
@tsamb
tsamb / zoo.js
Created February 6, 2014 17:13 — forked from dbc-challenges/zoo.js
//------------------------------------------------------------------------------------------------------------------
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here.
//------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------
// DRIVER CODE: Do **NOT** change anything below this point. Your task is to implement code above to make this work.
//------------------------------------------------------------------------------------------------------------------