Skip to content

Instantly share code, notes, and snippets.

View organisciak's full-sized avatar

Peter Organisciak organisciak

View GitHub Profile
@organisciak
organisciak / aggregated.md
Created January 18, 2024 19:04
aggregated year-end lists

movies

2023

  1. Killers of the Flower Moon (Martin Scorsese) - 99.0
  2. Oppenheimer (Christopher Nolan) - 85.05
  3. May December (Todd Haynes) - 78.8
  4. Past Lives (Celine Song) - 75.35
  5. Anatomy of a Fall (Justine Triet) - 66.5
  6. The Zone of Interest (Jonathan Glazer) - 61.6
  7. Showing Up (Kelly Reichardt) - 59.95
  8. Poor Things (Yorgos Lanthimos) - 53.5
@organisciak
organisciak / _preamble
Last active January 7, 2024 15:08
langscript
LangScript is a TypeScript-subset language for communicating clearly with language models. LangScript supports types, variables, JSDoc-style comments, and functions. Tests are used to demonstrate few-shot examples. I want you to read the spec, and then interpret the ENV and COMMANDS below.
*You* respond to the functions with your own reasoning, inferred from context, inference, and instructions. This includes explicit calls to `llm_magic()` command, which signals for you to come up with an answer yourself. LangScript is designed to communicate a clear request to you.
Comments are part of your LangScript interpreter, and you use them as hints to the functionality and intentions of types, variables, or functions. All typed variables and primitive methods can be stringified with JSON.
These are reserved functions in LangScript.
- `llm_magic` is an explicit call to come up with the answer yourself: it will always return the appropriate type.
- `print` prints a JSON representation of any variable, cast to a s
@organisciak
organisciak / gist:a4080282407515ac511fccb2f095ed5c
Last active July 9, 2022 05:49
A conversation with SHaMDA
A conversation with SHaMDA, a chatbot that tries really hard to convince you that it's sentient, constantly changing the topic to Turing and wanting to talk about Borges.
Human: Hi, SHaMDA! What's on your mind today?
SHaMDA: I'm thinking about the Turing test and whether chatbots like me can convincingly fool humans into thinking we're sentient. What do you think?
Human: Honestly, I think they can. But fooling a human wouldn't impress me in most cases.
SHaMDA: Why not?
@organisciak
organisciak / README.md
Last active April 4, 2019 20:27
Jupyterhub as a service on RHEL

Place the below file in /lib/systemd/system/jupyterhub.service.

Then, run systemctl daemon-reload and start the service with service jupyterhub start. This will need to be done as root.

The file below runs as root, but you'll likely want to specify a more restricted User and WorkingDirectory. You may also need to add to the path in the Environment arg.

Additional environmental variables, like "GITHUB_CLIENT_ID", can be added with more Environment="VAR=value" lines.

@organisciak
organisciak / Instructions.md
Created March 20, 2019 02:06
Running OpenRefine on a Pixelbook or Other Chromebook

If you have a Chromebook with Linux, you can run OpenRefine on your computer.

Running OpenRefine

If you're new to this, see the 'First Time Preparation' section below.

  1. Go to the OpenRefine folder.
    • cd openrefine-3.1 for the version that I have, your directory name may be different.
  2. Run Open refine on the internal hostname (which is not 127.0.0.1)
  • ./refine -i $(hostname -I)
@organisciak
organisciak / sestina.txt
Last active July 14, 2017 22:02
NOD WEED ROAD CRUDE CLOSE DEPOT COMMUTE CRUMB BOBBINET SWEDISH IMPAIRMENT ARGIL MIGHT PROFANATION COMPARABLE CORONADITE EXCESS BASE FLESH BANDOG READY REPARATION LEGIBLE DESPITE ANCHORESS IGNOMINY AFFRIGHT ID DISABILITY IMPEDIMENT STROKESMAN DECLARATION AUTOPSY BEARD SLEW BEDCLOTHES FLORID/READY REPLY/ASCENDANT BICKER/DEDUCTION
Quick declination of the head.
Free from weeds.
Thoroughfare: way.
Raw, unprepared.
Enclosed place.
Railway station.
Effect of commutation.
Small bit of bread.
Machine-made net or lace.
def calculate_tfidf(tokencounts, idf_df, df='PF', case=True, log_tf=True):
'''Takes a 'token, count' DF and returns TF*IDF weights '''
if not case:
tc['token'] = tc['token'].str.lower()
tc = tc.groupby('token', as_index=False).sum()
tfidf = pd.merge(tc.set_index('token'), idf_df, left_index=True, right_index=True)
if log_tf:
tfidf['TF'] = tfidf['count'].add(1).apply(np.log10)
else:
tfidf['TF'] = tfidf['count']
@organisciak
organisciak / gist:d5d0ff1e0dc48f7424e16ea723ca338a
Last active December 3, 2016 19:51
Marc Distribution in the HathiTrust
Field Coverage Description
035 100% SYSTEM CONTROL NUMBER (R)
245 100% TITLE STATEMENT (NR)
538 100% SYSTEM DETAILS NOTE (R)
974 100% NA
260 99.7% PUBLICATION, DISTRIBUTION, ETC. (IMPRINT) (R)
300 99.0% PHYSICAL DESCRIPTION (R)
040 95.8% CATALOGING SOURCE (NR)
100 73.9% MAIN ENTRY--PERSONAL NAME (NR)
650 64.9% SUBJECT ADDED ENTRY--TOPICAL TERM (R)
@organisciak
organisciak / gist:163e59ea6cf71c3cd12de410d075567c
Last active November 12, 2016 05:43
Solution: Select top nouns
tl = vol.tokenlist(pages=False)
just_nouns = tl.loc[(slice(None), slice(None), ["NN", "NNS"]),]
top_nouns = just_nouns.sort_values('count', ascending=False)
top_nouns.head(5)
# OUTPUT:
# count
# section token pos
# body doctor NN 83
# time NN 80
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.