Skip to content

Instantly share code, notes, and snippets.

View richashworth's full-sized avatar

Richard Ashworth richashworth

View GitHub Profile
@richashworth
richashworth / theme.conf
Created May 9, 2025 12:58
kitty theme based on tokyonight_moon
# vim:ft=kitty
## name: Tokyo Night Moon
## license: MIT
## author: Folke Lemaitre
## upstream: https://github.com/folke/tokyonight.nvim/raw/main/extras/kitty/tokyonight_moon.conf
background #222436
foreground #c8d3f5
vim:fileencoding=utf-8:foldmethod=marker
# Ensures that the configuration file is encoded in UTF-8 and uses marker-based folding.
include ~/.config/kitty/theme.conf
# Includes an external theme configuration file for consistent theming.
font_family Maple Mono NF
# Sets the font.
italic_font auto
@startgantt
<style>
ganttDiagram {
task {
FontName Helvetica
FontColor black
FontSize 12
FontStyle
BackGroundColor GreenYellow
const MILLIS_PER_DAY = 1000*60*60*24
const HEADER_ROWS = 1
function hide() {
const ss = SpreadsheetApp.getActiveSpreadsheet()
const sheet = ss.getSheets()[0]
const dateCol = sheet.getRange("A:A").getValues().map(function(row) {
return row[0]
})
pos_adjs = ', '.join(get_related_adjectives("climate change", nlp(positive_phrase)))
neg_adjs = ', '.join(get_related_adjectives("climate change", nlp(negative_phrase)))
pos_row = [positive_phrase, pos_adjs, TextBlob(pos_adjs).sentiment[0]]
neg_row = [negative_phrase, neg_adjs, TextBlob(neg_adjs).sentiment[0]]
HTML(DataFrame([pos_row, neg_row], columns=["Text", "Relevant_Adjectives", "Relevant_Sentiment"]).to_html(index=False)
climate_change_forms = ["The facts about climate change",
"Changes in our climate",
"The climate is changing rapidly",
"Because the climate has changed,"]
df = DataFrame(climate_change_forms, columns=["Text"])
df['Lemmas'] = list(map(lambda x: ' '.join(list(map(lambda y: y.lemma_, nlp(x)))), climate_change_forms))
HTML(df.to_html(index=False))
positive_phrase = "It's great that people are talking about climate change"
negative_phrase = "Rapid climate change is bad for the environment"
for x in [positive_phrase, negative_phrase]: spacy.displacy.render(nlp(x), jupyter=True)
from textblob import TextBlob
positive_phrase = TextBlob("It's great that people are talking about climate change")
positive_phrase.sentiment_assessments