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 imageSource = $('.main-photo').src; | |
var photoPage = window.location.href; | |
var htmlString = '<a href="' + photoPage + '"><img src="' + imageSource + '"></a>'; | |
console.log(htmlString); |
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
/* Yes, I'm going to CSS hell! Install stylish browser extension then add this for clubhouse.io */ | |
/* We don't find story and user ID useful so hide them */ | |
.bucket-content .story-id, | |
.project-name { | |
display: none; | |
} | |
/* Font size 0 needed to hide forward separator between owners */ | |
.bucket-content .story-summary { |
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 openLunch() { | |
var restaurant = sheet.getRange("B1").getValues()[0][0]; | |
var deadline = sheet.getRange("B2").getValues()[0][0]; | |
triggerSlackRequest("main", "@london: FRIDAY LUNCH: *"+ restaurant +"*. Please order by *"+ deadline +"*. Cheers.\n"+ sheetURL); | |
createTimeTriggers(2); | |
} |
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 createTimeTriggers(hour) { | |
ScriptApp.newTrigger('lunchReminder') | |
.timeBased() | |
.everyHours(hour) | |
.create(); | |
ScriptApp.newTrigger('notifyOrdersAppearCompleted') | |
.timeBased() | |
.everyMinutes(5) | |
.create(); |
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 notifyOrdersAppearCompleted() { | |
var curHour = new Date().getHours(); | |
var notifiedCell = sheet.getRange("F3").getValues()[0][0]; | |
if (notifiedCell == true) { | |
return | |
} | |
if (curHour > 17 || curHour < 9) { | |
Logger.log("Outside work hours stopping"); |
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 closeLunch() { | |
var triggers = ScriptApp.getProjectTriggers(); | |
updateUnattendingRows(); | |
triggerSlackRequest("main", "Lunch orders are now closed"); | |
triggerSlackRequest(completedOrdersUser, "Lunch is now officially closed"); | |
for (var i = 0; i < triggers.length; i++) { | |
if (triggers[i].getHandlerFunction() == "lunchReminder" || triggers[i].getHandlerFunction() == "notifyOrdersAppearCompleted") { | |
ScriptApp.deleteTrigger(triggers[i]); |
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 updateUnattendingRows() { | |
var attendingValues = sheet.getRange(startRow,4,rowRange,1).getValues(); | |
var color = "lightgrey" | |
for (var i = 0; i < attendingValues.length; i++) { | |
var rr = sheet.getRange("A"+(i+startRow)+":I"+(i+startRow)) | |
if(attendingValues[i][0] === false && rr.getBackground() != color) { | |
rr.setBackground(color); | |
} else { |
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 lunchReminder() { | |
var curHour = new Date().getHours(); | |
if (curHour > 17 || curHour < 9) { | |
Logger.log("Outside work hours stopping"); | |
return | |
} | |
var completedValues = sheet.getRange(startRow,1,rowRange,1).getValues(); | |
var slackNames = sheet.getRange(startRow,2,rowRange,1).getValues(); |
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 geckoboard, datetime, bme680 | |
# Set up Pimroni BME680 sensors | |
# https://github.com/pimoroni/bme680-python/blob/master/examples/read-all.py | |
sensor = bme680.BME680() | |
sensor.set_humidity_oversample(bme680.OS_2X) | |
sensor.set_pressure_oversample(bme680.OS_4X) | |
sensor.set_temperature_oversample(bme680.OS_8X) |
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 bs4 import BeautifulSoup | |
from yaml import load, dump | |
html_doc = open('raw.html') | |
soup = BeautifulSoup(html_doc, 'html.parser') | |
teamMembers = (soup.find_all(class_="t-member")) | |
for member in teamMembers: |
OlderNewer