Skip to content

Instantly share code, notes, and snippets.

View towerofnix's full-sized avatar
🏳️‍⚧️
𝄞‍ — keeping busy's more fun in good company

(quasar) nebula towerofnix

🏳️‍⚧️
𝄞‍ — keeping busy's more fun in good company
View GitHub Profile
@towerofnix
towerofnix / gist:8e5950795182932ac83eef28fdcbbcc9
Created February 18, 2017 13:33
If you find this post, it was abandoned
[quote=PintOfMilk][quote=BookOwl]2. Collaborations take a lot of time and effort to succeed, which most Scratchers are not willing to do.[/quote]
2. But there should be some already and there are tons of collabs. At least 3 pages.
[/quote]
In fact there's [url=https://scratch.mit.edu/discuss/10/]over 400 pages[/url] on the Collaborations forum index. But most collaborations get, well, demotivated, at one point in another. That's often because of boredom, or because of people (sometimes subconsciously) worrying about how [i]big[/i] of a project they're doing and what needs to be done and stuff.
With Scratch, you can't really have people collaborate on the [i]scripts[/i] of a project. Not directly. You can ask people about bugs in your projects, and try to figure out what the bug is with other people, but at the end, [i]you're[/i] still the programmer of the project. You still have to tie everything together. So almost all collaborators have one "master" programmer who programs [i]everything[/i]. And huge proj
// CREDITS: quat
reallySuperLongTypeNameThatIDontReallyCareAbout t = new reallySuperLongTypeNameThatIDontReallyCareAbout()
@towerofnix
towerofnix / pick-a-country.js
Created November 20, 2016 20:54
Picks a country for you to study. (Actually, three.)
fetch('https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_and_their_capitals_in_native_languages')
.then(res => res.text())
.then(resText => (new DOMParser()).parseFromString(resText, 'text/html'))
.then(doc => (
Array.from(doc.getElementsByClassName('wikitable'))
.map(tbl => tbl.querySelectorAll('tr'))
.reduce((f, tf) => f.concat(Array.from(tf)), [])
.map(r => r.children[0])
.map(t => t.innerText)
))
@towerofnix
towerofnix / stupid.js
Last active November 7, 2016 21:14
Why is this so fast
const createObject = function() {
const properties = new Map()
let prototype = null
const obj = {
get: function(key, bindFunction = true) {
let value
// If we don't have this property, and we do have a prototype, search
@towerofnix
towerofnix / demo.js
Last active November 2, 2016 18:50
Basic menu items
const page = document.getElementById('page')
const initEditableElement = function(el) {
const menu = createContextMenu('Demo menu', [
['Insert new div', [
['Before', () => {
alert('Insert before')
}],
['After', () => {
alert('Insert after')
@towerofnix
towerofnix / ds-utils.sh
Last active October 10, 2016 17:38
Makes Nintendo DS devkitPro development less hard, so you can finally Do Stuff!
read -r -d '' DOCS <<EndDocs
# -- DS Util --
# Only the most helpful utility on the whole file system!
#
# Basics and Config Structure
# DS Util is a project I made so that it's easier to Do Stuff related to the
# Nintendo DS. Read on to learn about the various functions this publishes.
#
# All this stuff almost definitely only works on Mac OS X (or macOS, or
# whatever they call it now).
@towerofnix
towerofnix / sa.js
Created September 20, 2016 19:59
<sa> - Small <a>s
// <sa> - small <a>
const dictionary = {
'congruent': '#definition-of-congruent',
'right angle': '#definition-of-right-angle',
'right angles': '#definition-of-right-angle',
'definition of supplementary': '#definition-of-supplementary',
'congruent supplementary angles': '#congruent-supplementary-angles'
@towerofnix
towerofnix / main.java
Last active August 16, 2016 22:05
Get NBT Data Tag from Item Stack
// Do note this is for NMS ItemStacks, not Bukkit ItemStacks.
// You'll need to use CraftItemStack.asCraftCopy/CraftItemStack.asCraftCopy
// if you plan on using Bukkit ItemStacks.
// Imports at top of file
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.ItemStack;
// Add this is a method to whatever
private NBTTagCompound getTag(ItemStack stack) {
@towerofnix
towerofnix / datatagserialize.js
Last active August 7, 2016 01:24
A handy function to convert your JS data to data tags.
const dataTagSerialize = function(data) {
if (typeof data === 'object') {
if (Array.isArray(data)) {
const elements = data.map(x => dataTagSerialize(x))
return `[${elements.join(',')}]`
} else {
const keyValues = []
for (let prop of Object.getOwnPropertyNames(data)) {
keyValues.push([prop, dataTagSerialize(data[prop])])
}