This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package $PACKAGE; | |
import net.minecraft.block.Block; | |
import net.minecraft.block.Blocks; | |
import net.minecraft.item.Item; | |
import net.minecraft.item.ItemGroup; | |
import net.minecraft.block.material.Material; | |
import net.minecraftforge.fml.RegistryObject; | |
import net.minecraftforge.fml.common.Mod; | |
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Default values for parameter 'inventoryTab' | |
# If the argument does not match one of the values below a custom inventory tab will be created | |
BREWING | |
BUILDING_BLOCKS | |
COMBAT | |
DECORATIONS | |
FOOD | |
HOTBAR | |
INVENTORY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.grid { | |
display: grid; | |
place-items: center; | |
} | |
/* or */ | |
.flex { | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
justify-content: center; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function normalise(str, outSep = ',') { | |
const R = String.raw | |
const re = str => RegExp( | |
str.replace(/ /g, R`\s*`).replace(/-/g, r.sep).replace(/[DMY]/g, c => r[c.toLowerCase()]), | |
'g' | |
) | |
const monthsL = 'January February March April May June July August September October November December'.toLowerCase().split(' ') | |
const monthsS = monthsL.map(month => month.substr(0, 3)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place in devtools | |
function decss(html) { | |
return html | |
.replace(/<link\s+rel=('|"|\s*)stylesheet.*?>/g, '') | |
.replace(/style=".+?"/g, '') | |
} | |
basehtml = document.getElementsByTagName('html')[0] | |
basehtml.innerHTML = decss(basehtml.innerHTML) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Synaptic = require('synaptic'); | |
const NUM_INPUTS = 2; | |
const HIDDEN = 1; | |
const NUM_OUTPUTS = 1; | |
const network = new Synaptic.Architect.Perceptron( | |
NUM_INPUTS, | |
HIDDEN, | |
NUM_OUTPUTS | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let cssOutput = ` | |
outer1 { | |
prop1: true; | |
inner {prop2: true;} | |
} | |
outer2 { | |
prop3: false; | |
} | |
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _(type, val) { | |
if (!(val instanceof type) && (type(val) !== val)) | |
throw new TypeError(`${JSON.stringify(val)} is not assignable to type "${type.name}"`); | |
return val; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let a = [1] | |
let b = a | |
b.push(2) | |
console.log(a) // [1,2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function flatten(str) { | |
return str.replace(/\r?\n|^\s+|\s+#\s.+$/gm, '').replace('(?x)', '') | |
} |
OlderNewer