Skip to content

Instantly share code, notes, and snippets.

View fakerybakery's full-sized avatar
🤗
Check out my HF profile!

mrfakename fakerybakery

🤗
Check out my HF profile!
View GitHub Profile
@fakerybakery
fakerybakery / overscroll-demo
Created September 22, 2021 17:03
This simple CSS file prevents overscrolling but has major bugs on Safari in iOS 15.
html {
overflow: hidden;
}
body {
height: 100%;
overflow: auto;
}
@fakerybakery
fakerybakery / README.md
Last active October 13, 2023 16:07
Play songs on your Arduino without a speaker - with only a passive buzzer! [Code included below] - © 2023 mrfakename. All rights reserved.

Arduino Songs

Play song using your Arduino with just a passive buzzer and NO speaker!!! Songs available so far:

  • The Star Spangled Banner
  • I'm a Little Teapot

Ultra-Restrictive Triple License

DOUBLE LICENSE: CC-BY-NC-ND + AGPL (Not DUAL license, but DOUBLE, this means that the most restrictive clauses of BOTH licenses apply, and the more restrictive clause overrides the less restrictive clause of the other license.) Non-Commercial Only! In addition, the following license applies:

NO PART OF THIS PRODUCTION MAY BE REPRODUCED, COPIED, AND/OR USED WITHOUT PRIOR WRITTEN PERMISSION FROM mrfakename.

@fakerybakery
fakerybakery / lettergrades.php
Created October 19, 2022 21:26
PHP Letter Grade Generator
<?php
function lettergrade($g) {
if ($g >= 97) {
return 'A+';
} elseif ($g >= 93) {
return 'A';
} elseif ($g >= 90) {
return 'A-';
} elseif ($g >= 87) {
return 'B+';
@fakerybakery
fakerybakery / simplestations.json
Last active October 26, 2022 20:54
NOAA Weather Stations (XML & JSON)
[
{
"id": "CWAV",
"lat": 51.76667,
"lon": -114.68333
},
{
"id": "CWBO",
"lat": 50.55,
"lon": -111.85
@fakerybakery
fakerybakery / README.md
Last active October 13, 2023 16:05
file_get_contents caching in PHP
@fakerybakery
fakerybakery / emojis.json
Last active March 11, 2023 18:44
PHP Emoji Array Generator - GitHub Emoji - Generate an array of emojis and corresponding names!
{
"+1": "https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png?v8",
"-1": "https://github.githubassets.com/images/icons/emoji/unicode/1f44e.png?v8",
"100": "https://github.githubassets.com/images/icons/emoji/unicode/1f4af.png?v8",
"1234": "https://github.githubassets.com/images/icons/emoji/unicode/1f522.png?v8",
"1st_place_medal": "https://github.githubassets.com/images/icons/emoji/unicode/1f947.png?v8",
"2nd_place_medal": "https://github.githubassets.com/images/icons/emoji/unicode/1f948.png?v8",
"3rd_place_medal": "https://github.githubassets.com/images/icons/emoji/unicode/1f949.png?v8",
"8ball": "https://github.githubassets.com/images/icons/emoji/unicode/1f3b1.png?v8",
"a": "https://github.githubassets.com/images/icons/emoji/unicode/1f170.png?v8",
@fakerybakery
fakerybakery / install.sh
Last active April 5, 2023 19:44
My Flarum extension list
# I do not endorse any extensions on this list
composer require michaelbelgium/flarum-discussion-views
composer require justoverclock/flarum-ext-feedback:"*"
composer require clarkwinkelmann/flarum-ext-shadow-ban
composer require zerosonesfun/flarum-up:"*"
composer require datlechin/flarum-posted-on:"*"
composer require nosun/reply-to-see
composer require clarkwinkelmann/flarum-ext-anonymous-posting
composer require blomstra/cache-assets:*
composer require the-turk/flarum-stickiest:^3.0.0
@fakerybakery
fakerybakery / README.md
Created April 16, 2023 22:35
OpenAI Whisper on M1 Mac

OpenAI Whisper on M1 Mac

whisper video.mp4 --output_format=txt --model=base --device=mps

This may give an error. Please comment in that discussion instead of here.

@fakerybakery
fakerybakery / pynljoin.py
Last active October 13, 2023 16:04
PyNLjoin (Python Natural Language Join) – Join lists using natural language
# AGPL License
def join_items(items):
if len(items) == 1:
return items[0]
elif len(items) == 2:
return ' and '.join(items)
else:
return ', '.join(items[:-1]) + ', and ' + items[-1]
@fakerybakery
fakerybakery / main.md
Created May 20, 2023 23:52
HF Python Tutorial (Step By Step)
  1. Install Python - Go to the Python website, click Downloads, and click the Download Python 3.x button. The Python website should select the correct version for you. Run the downloaded installer.
  2. Open Terminal or the Command Prompt. Type in pip3 install torch torchvision torchaudio transformers and press Enter. Once that's completed, type python3
  3. Create a new text file. Paste the following into the file. Save it, calling it generation.py
# Import Modules
from transformers import AutoTokenizer, AutoModelWithLMHead
import torch
# Setup Tokenizer and Model
tokenizer = AutoTokenizer.from_pretrained('MODEL_ID')