Skip to content

Instantly share code, notes, and snippets.

Avatar
🏳️‍🌈

Ell Ellpeck

🏳️‍🌈
View GitHub Profile
View namegen.py
from names_dataset import NameDataset
import json
nd = NameDataset()
firsts = []
lasts = []
countries = ["GB", "US", "FR", "DE", "PT", "ES", "NL", "IT", "MX", "CO", "ZA", "US"]
for country in countries:
print(country)
@Ellpeck
Ellpeck / Obsidian Daily Streaks.js
Last active Mar 16, 2022
A simple script that can be used with Obsidian's Dataview plugin to display daily streaks of habits from your daily notes.
View Obsidian Daily Streaks.js
// For this script to work properly, each daily habit has to start with a unique emoji,
// which will also be displayed next to the daily streak for each habit.
// Daily streaks are calculated for the currently opened daily note, and end on the first day
// that the habit was not ticked off. They are displayed in order of highest to lowest length.
// To display the result of this script in your daily notes, you can use this snippet:
// ```dataviewjs
// dv.view("path/to/Obsidian Daily Streaks.js");
// ```
// This is the directory that your daily notes are in
@Ellpeck
Ellpeck / GoogleFormsToNextcloudFiles.gs
Created Feb 19, 2022
A simple script for Google Apps Script that automatically creates a new markdown file in a Nextcloud directory for each new Google Forms response
View GoogleFormsToNextcloudFiles.gs
// How to use:
// 1. Open the script editor for the form ("Script Editor" in top right menu)
// 2. Create a new file, paste this code and edit the settings below
// 3. Go to Triggers and add a new trigger with the following settings:
// - Function: onFormSubmit
// - Event source: From form
// - Event type: On form submit
// 4. Allow permissions, and you're done!
// link to root of cloud installation
@Ellpeck
Ellpeck / Populate Data Texture Atlas.lua
Created Nov 11, 2021
This is a lua script for Aseprite that allows automatically populating a MLEM.Data Data Texture Atlas.
View Populate Data Texture Atlas.lua
-- This is a lua script for Aseprite that allows automatically populating a MLEM.Data Data Texture Atlas.
-- To use this script, you need to select a rectangular area that should be your texture region.
-- If you want a custom pivot point, you also need to un-select exactly one pixel, the pivot point.
-- When you then execute the script and input the name of the texture region, it gets appended to the "SpriteName.atlas" file.
-- get the currently selected sprite
local selection = app.activeSprite.selection
if selection == nil then return end
local bounds = selection.bounds
@Ellpeck
Ellpeck / GoogleFormsToNextcloudDeck.gs
Last active Nov 9, 2021
A simple script for Google Apps Script that automatically creates a new card in Nextcloud Deck for each new Google Forms response
View GoogleFormsToNextcloudDeck.gs
// How to use:
// 1. Open the script editor for the form ("Script Editor" in top right menu)
// 2. Create a new file, paste this code and edit the settings below
// 3. Go to Triggers and add a new trigger with the following settings:
// - Function: onFormSubmit
// - Event source: From form
// - Event type: On form submit
// 4. Allow permissions, and you're done!
// link to root of cloud installation
@Ellpeck
Ellpeck / pk3ds_length_shuffle.py
Created Jan 4, 2021
A simple script to shuffle pk3DS text dumps with a lower chance of the game crashing (by only shuffling strings with similar lengths)
View pk3ds_length_shuffle.py
# shuffles a pokemon 3ds language document based on string length with a given leeway
# needs storytext.txt and gametext.txt in the same directory
from random import randrange
# amount of characters that two string lengths can be different by to allow shuffling
leeway = 3
def is_allowed_line(line):
@Ellpeck
Ellpeck / c.c
Last active Aug 18, 2021
A cheat sheet that I use for C programming
View c.c
// Basically imports
// <> import something from a standard library location
// "" import something from an actual path
#include <stdio.h>
#include <stdlib.h>
// Preprocessor instructions with ifdef and ifndef, needs endif at the end
// ifndef = if not defined
#ifndef OOF
// Define a variable just to do the if check