Skip to content

Instantly share code, notes, and snippets.

View FOLLGAD's full-sized avatar
🌍
meandering

Emil Ahlbäck FOLLGAD

🌍
meandering
View GitHub Profile
#!/bin/bash
# Save screenshot with timestamp to Desktop
filename="$HOME/Pictures/Screens/Screenshot_$(date +%Y-%m-%d_%H.%M.%S).png"
screencapture -i "$filename"
# Copy the new file to clipboard if it exists (only if you didn't cancel the screenshot)
if [ -f "$filename" ]; then
osascript -e 'set the clipboard to (read (POSIX file "'"$filename"'") as TIFF picture)'
fi
#### ..# ####
## . ..## ### #####.##
### # ##. ## .## .. ####.#
##.###.##.# ### ## ## ##_
####_#_ # ## ## -##__/
### \ # ## ## ## #
| v /
| |_#
##_____/ O k_#k
##-_____ |
@FOLLGAD
FOLLGAD / llama-13b.sh
Created April 8, 2023 09:00
script for downloading llama 13B weights
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the GNU General Public License version 3.
#
# UPDATE from Shawn (Mar 5 @ 2:43 AM): Facebook disabled this URL. I've mirrored the files to an R2 bucket, which this script now points to.
#
#PRESIGNED_URL="https://dobf1k6cxlizq.cloudfront.net/*?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kb2JmMWs2Y3hsaXpxLmNsb3VkZnJvbnQubmV0LyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2NzgzNzA1MjR9fX1dfQ__&Signature=a387eZ16IkmbotdkEl8Z397Mvxhw4Bvk4SpEiDkqMLOMVMk5F962BzN5eKO-061g5vAEskn-CSrf4w3knubwPiFW69LTsJ8Amj-WOvtBOBy9soc43j77WGUU-3q2eNjMIyNZYsD~rub4EkUJGNpD61YtRrFvAU7tNQ1YMNL5-UUOk1~OHeaWerWisKPldufOyX6QdrrjeToVH1L0eGm1Ob4LnoYyLH96BHFou4XsOUR8NuyQfwYtmE2G6P2eKk~OV9-ABzYHxC2DyOWiWnt7WO~ELHnf17s9qreQAjEkCGEi4pHJ7BIkg6~ZfRmvRl3ZaPtqD80AH4SfO4hd5WQ0ng__&Key-Pair-Id=K231VYXPC1TA1R" # replace with presigned url from email
PRESIGNED_URL="https://agi.gpt4.org/llama/
@FOLLGAD
FOLLGAD / easy-2fa.sh
Last active April 1, 2023 13:13
Simple commandline 2FA tool. Alternative to Google Authenticator and Authy apps.
DB_FILE=example-2fa-db.txt
# use fuzzyfinder to search for which service to use
LINE="$(cut -d: -f1 $DB_FILE | fzf)"
# get the private key of line
AUTH_CODE="$(grep "^$LINE:" $DB_FILE | cut -d: -f2-)"
# print the temporary 2fa code
echo "$(oathtool -b --totp "$AUTH_CODE")"
@FOLLGAD
FOLLGAD / chatgpt-fake-news-classification.ipynb
Last active March 8, 2023 15:26
Fake News Classification using ChatGPT (~83% accuracy)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1
00:00:00,000 --> 00:00:08,780
Hello, everyone, and welcome to Module 10 of the Machine Learning course, which is about
2
00:00:08,780 --> 00:00:15,000
data generation or synthesis.
3
00:00:15,000 --> 00:00:21,000
@FOLLGAD
FOLLGAD / music-video-gen.ipynb
Last active March 8, 2023 15:27
Music video generation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FOLLGAD
FOLLGAD / reorderable-menu.jsx
Last active October 3, 2022 18:52
Ant Design (antd) re-orderable menu using react-beautiful-dnd
import {
DragDropContext,
Draggable,
Droppable,
} from "react-beautiful-dnd";
import React, { useCallback, useMemo } from "react";
import { Menu } from "antd";
const renderMenuFn =
(item, props) =>
@FOLLGAD
FOLLGAD / hamming.js
Last active May 15, 2022 10:35
Bitburner hamming code solver
// translates dynamic-length hamming codes into raw data
function hamming(n) {
const s = n.length
let o = ""
let errors = []
for (let i = 1; i < s; i++) {
const pw2 = !( i & (i - 1) ) // is power of two
if (!pw2) {
o += n[i]
} else {
@FOLLGAD
FOLLGAD / HeadlessCollapse.tsx
Last active April 10, 2025 15:01
Antd simple headless collapse without the header
import { Collapse } from "antd";
import React, { FC, PropsWithChildren } from "react";
import styles from "./styles.module.scss";
interface Props {
expanded: boolean;
}
export const HeadlessCollapse: FC<PropsWithChildren<Props>> = ({
expanded,
children,