Skip to content

Instantly share code, notes, and snippets.

@joshhunt
joshhunt / original.md
Created August 25, 2023 19:52 — forked from yonta/original.md
Spawn Rules of Minecraft in Bedrock Edition

Spawn cycle

Bedrock Edition

Natural spawning in Bedrock Edition shares only a few similarities to natural spawning in Java Edition. In Bedrock Edition, there are two main types of natural spawns: pack spawns and structure mob spawns. Structure mob spawns are mobs spawned as part of a structure, such as nether fortresses, witch huts, etc. Pack spawns account for all other types of natural spawns, including mobs that spawn individually (i.e. not in a pack of 2 or more). Both types of natural spawns follow the same rules for spawn conditions and the mob cap.

@joshhunt
joshhunt / TypeHolesInTS.md
Last active September 24, 2020 15:02 — forked from disintegrator/TypeHolesInTS.md
Type holes in TypeScript

Type holes in TypeScript

In TypeScript there are a few ways you can sidestep type inference and the compiler to introduce type holes in your code. Type holes are parts of the code where we’ve lied or hid information from the compiler and can be a source of bugs that are not present in properly typed code. The common ones I see are listed below in order of really bad to bad.

Type casts

const something = getValue() as any;
const cat = dog as Cat;
const Header = styled.h1.attrs({
className: 'p2 bold white bg-blue'
})`
margin: 0 15px;
border-radius: 5px;
box-shadow: 0 2px 2px 0 #aaa;
`
@joshhunt
joshhunt / correct.js
Last active August 29, 2015 14:23 — forked from benjamingr/correct.js
function createUser(username, callback) {
DatabaseClient.connect()
.then(function(connection) {
return connection.collection('users')
})
.then(function(users) {
return users.query({username: username})
})
.then(function(exising){
if(existing) {
window.console.loge = function (msg) {
var gifs = ['wink','shake-space','peepers','prizza','hat','gradient','fat','rainbow','sunglasses','derp','shake'],
wow = ['', 'wow! ', 'amaze! ', 'dazzle! '],
adjs = ['so', 'such', 'many', 'much', 'very'],
randomizr = function (a) { return a[Math.floor(Math.random() * a.length)];},
message = '%c ' + randomizr(wow) + randomizr(adjs) + ' ' + typeof msg + ': ',
css = 'background-image: url(http://d1e3ezyatlol8u.cloudfront.net/img/212/doge-' + randomizr(gifs) + '-212.gif); background-size: 80px 80px; background-repeat: no-repeat; font-family: \'Comic Sans MS\', cursive; padding: 25px; line-height: 64px; color: white; font-weight: 800; width: 100%; display: block;';
console.log.apply(console, typeof msg === 'object' ? [message, css, msg] : [message += msg, css]);
};
var _log = console.log;
window.console.log = function(log){
_log.call(console, log.reverse ? log.reverse() : typeof log === 'string' ? log.split('').reverse().join('') : typeof log === 'number' ? log.toString().split('').reverse().join('') : log);
};