Skip to content

Instantly share code, notes, and snippets.

View fastfingertips's full-sized avatar
🧶
knitting..

fastfingertips

🧶
knitting..
  • Istanbul
  • 11:07 (UTC +03:00)
View GitHub Profile
@adtac
adtac / Dockerfile
Last active April 13, 2024 22:33
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@blackary
blackary / caching.py
Last active January 9, 2024 06:37
Caching Snowflake queries in Streamlit
def get_pandas_from_sql(sql: str) -> pd.DataFrame:
start = time.start()
with st.expander("Show the SQL query that generated this data"):
st.code(sql, language="sql")
@st.cache_data(ttl=TTL)
def get_df(sql):
dataframe = session.sql(sql).to_pandas()
@fastfingertips
fastfingertips / recycle_bin_manager.pyw
Last active August 17, 2023 11:39
This Python script lets you add or remove the Recycle Bin folder from the 'This PC' section on Windows by modifying the Windows Registry with the 'reg add' or 'reg delete' command. Use it with caution as changes to the Registry can have negative effects on the system.
import os
import sys
import ctypes
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QPushButton
def is_admin():
try: return ctypes.windll.shell32.IsUserAnAdmin()
except: return False
@TheBrokenRail
TheBrokenRail / README.md
Last active April 30, 2024 00:23
Jailbreak Firefox!

Jailbreak-Firefox

This script allows you to install unsigned extensions (ones that aren't approved by Mozilla) on normal Firefox builds and the official Snap! That's right, no "Firefox Developer Edition" nonsense required!

⚠️ Disclaimer ⚠️

This script is not well tested, like at all. This script might break things, possibly important things. You should probably take a backup of your Firefox profile before using it. You have been warned.

Dependencies

sudo apt install -y curl unzip zip
# Only needed when jailbreaking the Snap
@ace411
ace411 / scraper.cc
Created May 11, 2022 16:46
Web Scraping with C++
#include "iostream"
#include "string"
#include "algorithm"
#include "curl/curl.h"
#include "gumbo.h"
#include "string.h"
typedef size_t (*curl_write)(char *, size_t, size_t, std::string *);
std::string request(std::string word)
@frabert
frabert / COPYING
Last active December 21, 2023 13:35
Favicons for HN
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@fastfingertips
fastfingertips / wlan-details.ps1
Created March 10, 2022 12:46
lists saved wlan passwords
(netsh wlan show profiles) | Select-String “\:(.+)$” | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name=”$name” key=clear)} | Select-String “Key Content\W+\:(.+)$” | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table -AutoSize
@Meldiron
Meldiron / backup.sh
Last active May 5, 2024 10:45
Backup and Restore Appwrite, the lazy way 🐌
# Make sure to stop Appwrite before this backup,
# and make sure you have enough space on the machine.
# After backing up, make sure there is a file in 'backups/backup-___.tar.gz'.
# Also please check size of this file, it should be at least 5kb, even for small instances.
docker run --rm \
-v appwrite_appwrite-mariadb:/backup/appwrite-mariadb \
-v appwrite_appwrite-redis:/backup/appwrite-redis \
-v appwrite_appwrite-cache:/backup/appwrite-cache \

How to make a small tweak to free software

The target audience for this is people who are beginners at software engineering and using linux. A lot of the information here may be obvious or already known to you. The language involved is C but you do not need to know any C to read this tutorial. I used mg to write this blog post. I used vs code to edit the source code.

This post is also available on gopher://tilde.team:70/0/~river/tweak-free-software

If you use a piece of free software and it's 99% perfect but there's just this one thing it does that annoys the hell out of you.. you can in theory just fix it! Here's a look at what doing that is like. Hopefully it inspires you, or you pick up a could tricks on the way!

Step 0: Have a problem

@moyix
moyix / arith1000_t0.1_k0_p0.0_results.txt
Created February 10, 2022 21:52
Data files for GPT-NeoX-20B arithmetic (100 and 1000 questions)
Question Real Guess Correct? RelErr Digits
What is 18857 - 592? 18265 18265 Yes 0.0% 5/5
What is 30752 - 3087? 27665 27365 No 1.1% 4/5
What is 2241 + 19873? 22114 22114 Yes 0.0% 5/5
What is 5412 + 10169? 15581 15581 Yes 0.0% 5/5
What is 11831 - 9178? 2653 3153 No 18.8% 2/4
What is 1701 * 19933? 33906033 33953373 No 0.1% 4/8
What is 11648 + 17851? 29499 30509 No 3.4% 1/5
What is 29253 - 6202? 23051 22151 No 3.9% 3/5
What is 27365 + 24989? 52354 53554 No 2.3% 3/5