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
// Dirty overload the native function
var parseInt = function(arg1) {
if (arg1 === "Infinity") {
return NaN;
}
if (arg1 === "Infinity+1") {
return "Infinity1";
}
if (arg1 === "1+1+1") {
return "3?";
@HybridEidolon
HybridEidolon / pso2-sar-format.md
Last active July 3, 2023 20:00
Phantasy Star Online 2 Symbol Art Format

Symbol Art File Format (Phantasy Star Online 2)

SAR files are simple structures that are encrypted with Blowfish with a 32-bit key and optionally compressed with PRS and a 0x95 XOR.

Starting out

All sar files start with the magic ASCII string sar and, at position 0x03, either the byte 0x84 or 0x04.

Decrypting and Decompressing

@gobinathm
gobinathm / shallow_update_git.md
Created March 6, 2017 18:24
Fix for Remote rejected shallow update not allowed after changing Git remote URL

Some Time there is a shallow update not allowed issue in your cloned GIT repo.

This means that you have to unshallow your repository. To do so you will need to add your old remote again.

git remote add origin <path-to-old-remote> After that we use git fetch to fetch the remaining history from the old remote (as suggested in this answer).

git fetch --unshallow origin And now you should be able to push into your new remote repository.

@matthewr6
matthewr6 / autopull.go
Created July 5, 2016 01:55
automatically pull from master for all directories at the same level
package main
import (
"os"
"fmt"
"os/exec"
"io/ioutil"
)
func main() {
@jeandrek
jeandrek / clickbait.js
Last active May 28, 2016 08:47
Better clickbait (more clickbaity) http://jonathan50.github.io/clickbait.html
function Words(...templates) {
this.templates = templates
}
Words.prototype.generate = function() {
return this.templates.map(generate).join(' ')
}
function generate(template) {
if(template instanceof Words)
return template.generate()
@towerofnix
towerofnix / gems.md
Last active September 16, 2017 21:26
Particularly amazing gemstones in the virtual field of Scratch suggestions

Index: https://gist.github.com/towerofnix/ca9010add7d91bdbfd828ca829ee38e1

Particularly amazing gemstones in the virtual field of Scratch suggestions. Click on a link to get started! Each link brings you to a thread on the Scratch suggestion forums. These threads explain their suggestions better than most of the other suggestions on Scratch (of which half are duplicates!) so I figured I'd compile a list of the best suggestions here. I'm not saying I particularly like these suggestions but they generally are explained well and have pretty interesting suggestions. (At least, when not flooded by (no) "support"s!)

/* Notes: **READ ALL OF THESE**
Original source of the program is here:
https://scratch.mit.edu/discuss/post/1868091/
I've slightly modified the code (pretty-printed, renamed a couple variables,
etc. - don't forget to read these notes! - but the old code is still intact
here. If you're curious about what the original entirely non-modified code
was though don't hesitate to open that link. :P
@towerofnix
towerofnix / random-wikia-trivia.js
Last active August 2, 2020 23:15
Wikia trivia on anything! Just go to your favourite wiki and run this JavaScript code to get free trivia!
var what = "/Special:Random";
$.get(what).done(function(res) {
try {
res = (new DOMParser()).parseFromString(res, "text/html");
window.res = res;
what = res.querySelector("#WikiaPageHeader .header-title").textContent.trim();
@towerofnix
towerofnix / syntacticsugar.js
Created November 5, 2015 23:49
Faking JavaScript syntactic sugar
/*\
| Faking JavaScript syntactic sugar
|
| Feel free to fork this to add more information!
|
| Remember to utilize ES6 things, because why not?
| It's standardized!
\_
| Contents:
|