Skip to content

Instantly share code, notes, and snippets.

View Andrews54757's full-sized avatar

Andrew S Andrews54757

View GitHub Profile
@Andrews54757
Andrews54757 / MixinChestBlock.java
Created June 20, 2020 19:55
Litematica Mirror Fix
package fi.dy.masa.litematica.mixin;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import net.minecraft.block.BlockState;
import net.minecraft.block.ChestBlock;
import net.minecraft.block.enums.ChestType;
@Andrews54757
Andrews54757 / privacy.md
Created May 12, 2019 17:16
EZCite Privacy Policy

Foreword

Hello curious users! I am Andrew, the creator of EZCite. Please note that I am not a lawyer, I am just a student. Regarding this privacy policy, it is required by Google so here it is.

What data do I collect?

Absolutely none, not even google analytics. Although the extension has access to the webpages you visit (only if you click on the icon), it does not store or share that information at all. This extension should work perfectly offline.

Third Parties

Although I do not collect any data, there is a single third party (Easybib) which might collect your data. The extension uses their service to check if a website is credible. Please refer to their privacy policy here: https://www.chegg.com/privacypolicy

@Andrews54757
Andrews54757 / get.js
Created January 22, 2018 20:55
Get text from website preserving position
function isHidden(el) {
var style = window.getComputedStyle(el);
return (style.display === 'none')
}
function getOffset(el) {
var _x = 0;
var _y = 0;
while (el && !isNaN(el.offsetLeft) && !isNaN(el.offsetTop)) {
_x += el.offsetLeft - el.scrollLeft;
@Andrews54757
Andrews54757 / SQLHandler.php
Created April 6, 2017 21:00
SQLHandler.php
<?php
/*
USAGE:
$connector = new SQLConnector($options);
$SQLresponse = $connector->query("SELECT * FROM `yourdb`")
or
function toNum(a) {
return parseInt(a.join(""),2);
}
function toBin(a) {
return a.toString(2).split("")
}
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
}
};
xhttp.open("GET", "", true);
xhttp.send();
eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([0-9r-zA-Z]|[12]\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('1r 1R=[\'\\t\\1m\\Y\\t\\s\\1b\\1k\\1l\',\'\\s\\11\\1t\\1q\\10\\1f\\11\',\'\\1\\r\\1c\\1\\R\\14\\V\\x\\0\\R\\0\\15\\0\\1\\1l\\0\\3\\0\\E\\0\\N\\0\\9\\0\\16\\0\\z\\0\\9\\0\\3\\0\\t\\0\\1\\0\\6\\0\\5\\0\\F\\0\\1\\0\\w\\0\\8\\0\\2\\0\\A\\0\\8\\0\\3\\0\\E\\0\\1\\0\\6\\0\\5\\0\\T\\0\\1\\0\\6\\0\\5\\0\\D\\0\\1\\0\\6\\0\\5\\0\\D\\0\\z\\0\\D\\0\\4\\0\\I\\0\\1\\0\\s\\0\\9\\0\\2\\0\\2\\0\\9\\0\\3\\0\\17\\0\\1\\0\\6\\0\\5\\0\\4\\0\\1\\0\\5\\0\\z\\0\\2\\0\\7\\0\\y\\0\\v\\0\\2\\0\\A\\0\\5\\0\\4\\0\\18\\0\\1\\0\\s\\0\\1\\3\\0\\2\\0\\7\\0\\8\\0\\3\\0\\17\\0\\1\\0\\6\\0\\8\\0\\2\\0\\R\\0\\r\\0\\3\\0\\1\\0\\1\\0\\5\\0\\F\\0\\2\\0\\u\\0\\E\\0\\2\\0\\T\\0\\z\\0\\9\\0\\4\\0\\Z\\0\\1\\0\\6\\0\\s\\0
@Andrews54757
Andrews54757 / index.js
Created November 28, 2016 01:49
ANSI code getter
var stdin = process.stdin;
stdin.setRawMode(true);
stdin.resume()
stdin.setEncoding('utf8');
stdin.on('data',function(key) {
console.log(toUnicode(key));
if (key == '\u0003') { process.exit(); }
})
@Andrews54757
Andrews54757 / index.js
Last active October 16, 2016 22:28
Profanity filter
// use the checkifokay function to use. Returns true if okay, false for bad
var badtext = "fuck,bitch,dick,penis,cunt";
function StringBuild(string) {
this.d = [];
}
StringBuild.prototype.append = function(text) {
this.d.push(text)