Skip to content

Instantly share code, notes, and snippets.

@amrrs
amrrs / gist:884b58514ce545adaa5803c9333f4cc9
Created November 27, 2023 16:57 — forked from levelsio/gist:5bc87fd1b1ffbf4a705047bebd9b4790
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
# 2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com.
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same!
Send me your ChatGPT text adventure game on X, I'd love to try it!
import requests
model_id = "nvidia/segformer-b0-finetuned-ade-512-512"
api_token = # get yours at hf.co/settings/tokens
headers = {"Authorization": f"Bearer {api_token}"}
API_URL = f"https://api-inference.huggingface.co/models/{model_id}"
@amrrs
amrrs / panelmatplotlib.html
Created May 26, 2022 10:22
pyscript csv -> matplotlib
<html>
<head>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vega@5"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vega-lite@5"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vega-embed@6"></script>
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/js/tabulator.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-2.4.2.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.2.min.js"></script>
@amrrs
amrrs / avoid_colab_close.js
Created August 17, 2021 20:02
How to avoid Google Colab Session Closing automatically?
//credit - https://huggingface.co/blog/fine-tune-wav2vec2-english (Patrick von Platen)
// run this on your Chrome / Browser Console (where Colab is present)
function ConnectButton(){
console.log("Connect pushed");
document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click()
}
var colab = setInterval(ConnectButton,60000);
@amrrs
amrrs / gist:9ce2461c56f1d2cad4d2b16e3d1c646a
Last active July 19, 2019 00:42 — forked from bessarabov/gist:674ea13c77fc8128f24b5e3f53b7f094
One-liner to generate data shown in post 'At what time of day does famous programmers work?' — https://ivan.bessarabov.com/blog/famous-programmers-work-time
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }'
@amrrs
amrrs / hinton.py
Created May 27, 2019 11:51 — forked from wtznc/hinton.py
Web scrapper for Geoffrey Hinton's publications, +- 250MB
# download this file
# install bs4, re, urllib
# run python3 hinton.py
from urllib import request
import re
import os
from bs4 import BeautifulSoup
def main():
curdir = os.getcwd()
#!/bin/bash
TODAY=`date +%Y-%m-%d`
TODAY_MD=`date +%B\ %d,\ %Y`
YEAR=`date +%Y`
PACKAGENAME=$1
##
## CHANGE ME!!!
@amrrs
amrrs / plotly-docs.R
Created March 5, 2018 09:08 — forked from cpsievert/plotly-docs.R
Plotly examples
# install the new/experimental plotly R package
# devtools::install_github("ropensci/plotly@carson-dsl")
# ----------------------------------------------------------------------
# https://plot.ly/r/3d-line-plots/
# ----------------------------------------------------------------------
library(plotly)
# initiate a 100 x 3 matrix filled with zeros
@amrrs
amrrs / coindeskr_last31_btc.R
Created January 8, 2018 10:01
Visualizing Bitcoin Movement Last 31 days
library(coindeskr) #R-Package connecting to Coindesk API
library(ggplot2)
library(ggthemes)
#Extracting Bitcoin USD Price for the last 31 days
last31 <- get_last31days_price()
date <- rownames(last31)

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets