Skip to content

Instantly share code, notes, and snippets.

View TheOnlyTails's full-sized avatar
🏳️‍⚧️

TheOnlyTails TheOnlyTails

🏳️‍⚧️
View GitHub Profile
@TheOnlyTails
TheOnlyTails / userChrome.css
Last active March 19, 2022 20:20
My userChrome.css for Firefox (With Sideberry)
/*
TheOnlyTails's Personal userChrome.css for Firefox
Based on Drannex42's userChrome.css
*/
:root {
--sidebar-width: 50px;
--toolbar-height: -50px;
--menubar-height: -74px;
--sidebar-padding: calc(var(--sidebar-width) + 5px);
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"newline": true,
"segments": [
{
"foreground": "#d9d9d9",
"foreground_templates": ["{{ if gt .Code 0 }}#FF7700{{ end }}"],
class Main {
public static void main(String[] args) {
System.out.println("1\n3\n7\n15\n31\n63");
}
}
export type DocsMap = {
name: string;
path?: string;
type?: "page" | "category";
pages?: DocsMap[];
};
function filterPages(docsStructure: DocsMap[] | DocsMap): DocsMap[] {
if (Array.isArray(docsStructure)) {
// it's an array of pages/categories
<script lang="ts">
let count = 0;
</script>
<button on:click={() => count++}>{count}</button>
<style>
button {
color: red;
}
@TheOnlyTails
TheOnlyTails / flex.scss
Last active July 3, 2021 14:19
This is a mixin that allows you to configure the most common options when using Flexbox, all in one line of SCSS.
@mixin flex($direction: row, $justify: normal, $align: normal, $inline: false, $wrap: false, $gap: false) {
// display: flex/inline-flex
@if $inline { display: inline-flex } @else { display: flex }
// flex-direction
@if $direction == row { flex-direction: row
} @else if $direction == column { flex-direction: column
} @else if $direction == row-reverse { flex-direction: row-reverse
} @else if $direction == column-reverse { flex-direction: column-reverse }
@TheOnlyTails
TheOnlyTails / Why_MCreator_Sucks.md
Last active June 4, 2021 15:24
Why MCreator sucks, Remastered
@TheOnlyTails
TheOnlyTails / hammingCodes.kt
Last active May 6, 2021 10:21
This is a Kotlin implementation for the receiving end of a Hamming Codes (not extended). Given a matrix of bits organized according to a Hamming Code, it will return the location of an error in the matrix or return 0 if there are no errors. Note: the value of bit index 0 is not included in the result, thus you can't store any data in it.
fun hammingSyndrome(bits: List<Int>) =
// gets all the indices of 1 value, and places null in 0 values' indices.
bits.mapIndexed { index, it -> if (it == 1) index else null }
// removes all those null values.
.filterNotNull()
// XORs the indices together to get the index of the error
.reduce { acc, i -> acc xor i }
package com.crypticcosmos.crypticcosmos.blocks;
import com.crypticcosmos.crypticcosmos.registries.CrypticCosmosDimensions;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.RegistryKey;
package com.crypticcosmos.crypticcosmos.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.util.RegistryKey;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.Registry;