Skip to content

Instantly share code, notes, and snippets.

@YPetremann
YPetremann / SmallFlower.js
Last active March 24, 2024 23:32
Small Flower mod for Sixty Four
label =on 'Small Flower';
description = 'Make the flower smaller to easily see behind';
(function () {
let c = typeof configuration === 'object' ? configuration : {};
if (!c?.enabled) return;
const flowerImage =
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAccAAANPCAYAAACvgBQuAAAAw3pUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjabVDbDcMgDPxnio7gV8CMQ15SN+j4tTGRQpuTOB82HMbp+LzP9HIQSpKlaK45g0GqVGomFAKtM4J07tjKUDjnk5zAXZGlXMUONEfEKz8uXBGbqeVmpNsorHOhSkTSHyOKwN6R630Y1WHEFAUcBi2+BblquX9hPWCGxkpOonPbf/ti09sXe4eJDkYGY+YcDbAvSdxMsDHaIU9RzzhbeZjZQJ7mdCF9AYAtWXjGnEteAAABhGlDQ1BJQ0MgcHJvZmlsZQAAeJx9kT1Iw0AcxV9TpSIVBzOIOGSoThZFRRylikWwUNoKrTqYXPoFTRqSFBdHwbXg4Mdi1cHFWVcHV0EQ/ABxdnBSdJES/5cUWsR4cNyPd/ced+8AoVFhmtU1B2i6babiMSmbW5VCrwgiDBETGJeZZSTSixn4jq97BPh6F+VZ/uf+HH1q3mJAQCKeY4ZpE28Qz2zaBud9YpGVZJX4nHjMpAsSP3Jd8fiNc9FlgWeKZiY1TywSS8UOVjqYlUyNeJo4omo65QtZj1XOW5y1So217slfGM7rK2mu0xxGHEtIIAkJCmooowIbUVp1UiykaD/m4x9y/UlyKeQqg5FjAVVokF0/+B/87tYqTE16SeEY0P3iOB8jQGgXaNYd5/vYcZonQPAZuNLb/moDmP0kvd7WIkdA/zZwcd3WlD3gcgcYfDJ
@YPetremann
YPetremann / ExplicitEye.js
Last active March 24, 2024 23:31
Explicit Eye mod for Sixty Four
label =on 'Explicit Eye';
description = 'Make the Fill Director indication more visible and useful';
(function () {
let c = typeof configuration === 'object' ? configuration : {};
if (!c?.enabled) return;
Game.prototype.renderUnfilled = function () {
this.ctx.save();
const margin = this.pixelRatio * 16;
@YPetremann
YPetremann / ConstantPrice.js
Last active October 25, 2024 12:41
Constant Price mod for Sixty Four
label = 'Constant Price';
description = 'Make machine price to be constant';
(function () {
let c = typeof configuration === 'object' ? configuration : {};
if (!c?.enabled) return;
let _abstract_getCodex = abstract_getCodex;
abstract_getCodex = function () {
const dat = _abstract_getCodex();
@YPetremann
YPetremann / CompactShop.js
Last active March 24, 2024 23:29
Compact Shops mod for Sixty Four
label = 'Compact Shop';
description = ' Make the shop even more compact when you use the compact shop button';
(function () {
let c = typeof configuration === 'object' ? configuration : {};
if (!c?.enabled) return;
document.head.appendChild(document.createElement("style")).innerText = `
.shop.minimized .shopItem {
padding: 0.4em 0.6em;
@YPetremann
YPetremann / prisma-auto-excluder.js
Last active September 10, 2023 14:57
Prisma Auto Exclude
const { Prisma } = require("@prisma/client");
/**
* this plugin is used to automatically exclude fields from prisma queries
* this works with almost all prisma queries that use select and include
* if a custom query is used, it will not work by default,
* but it can by adding a $autoExclude:true to the args
* next to select and include, there is now exclude
* if a field ends with an underscore, it will be excluded unless explicitly in select or include
* truthy field in exclude will be excluded, even if present in select or include
@YPetremann
YPetremann / README.md
Created November 11, 2021 01:33
AwesomeWM easier binding

AwesomeWM easier key and mouse binding

Make it easier to define bindings by :

  • providing groups of bindings depending of context
  • provide a way to define every any bindings in one place (not mandatory through)
  • mixing key and mouse bindings (mouse bindings are detected as such and automaticaly moved to a separate set)
  • mouse bindings have more indicative alias (LMB, RMB, MWU, MWD)
  • easy text based binding definition
  • easy text based documentation definition
  • one time definition for multiple time usage (client, client_titlebar, taglists ...)
  • permit to pass parameters to bindings from specific context (client, tags, screens ...)
function hashCode(s){
return s
.split('')
.reduce((a,b)=>{a=((a<<5)-a)+b.charCodeAt(0);return a&a},0)
}
function hashColor(text){
return "#"+Math.abs(hashCode(text)).toString(16).slice(0,6)
}
function light(text){return text
.replace(/0/g,"8").replace(/1/g,"9").replace(/2/g,"A").replace(/3/g,"B")
@YPetremann
YPetremann / crosscode-translation-extract.js
Last active November 9, 2019 14:13
Crosscode Translation Project
const path = require('path')
const fs = require('fs')
function walkSync(dir) {
if(fs.statSync(dir).isDirectory()) {
var files = fs.readdirSync(dir)
files = files.map(file => walkSync(path.join(dir, file)))
return [].concat(...files)
} else {
return [dir]
@YPetremann
YPetremann / MinecraftEnergyTypes.md
Last active June 19, 2018 09:07 — forked from DeflatedPickle/MinecraftEnergyTypes.md
A simple table for Minecraft energy types and a matrix for conversion rates.

Minecraft Energy Types

Energy Name Abbreviation Original Mod Version
Anima AM Anima-Mundi 1.11.2
Blutricity BE (NO) Redpower 1.6.4
Charge RP (NO)/Fz? Factorization 1.7.10
Crystal Flux CF Actually Additions 1.12
Energy Units EU IndustrialCraft2 1.11
inventory:
'29':
- canfavorite: true
count: 1
equipstate: 0
favicontype: 43
favorite: -2
filterflag: 4
formid: 429299
handleid: 4207599785