Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

William williamsthing

Block or report user

Report or block williamsthing

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am williamsthing on github.
  • I am williamsthing (https://keybase.io/williamsthing) on keybase.
  • I have a public key ASDrd4gGu_AF6u6RbDrzlHzq-lcLp6ZvLrMhhmatLHic3Qo

To claim this, I am signing this object:

View mademy2018.js
function shuffleArray(array) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
}
const people = `
`; // put a friend for each new line in this string!!!
View bee.js
const escpos = require("escpos");
const device = new escpos.USB();
const printer = new escpos.Printer(device);
let script = `
According to all known laws
of aviation,
there is no way a bee
View keybase.md

Keybase proof

I hereby claim:

  • I am williamsthing on github.
  • I am williamsthing (https://keybase.io/williamsthing) on keybase.
  • I have a public key ASA8YllfXMpCJQiJo06pZFzEMwd_X2xN3nJJHLCfwxvlcgo

To claim this, I am signing this object:

View keybase.md

Keybase proof I hereby claim: * I am williamsthing on github. * I am williamsthing (https://keybase.io/williamsthing) on keybase. * I have a public key ASA8YllfXMpCJQiJo06pZFzEMwd_X2xN3nJJHLCfwxvlcgo To claim this, I am signing this object: ```json { "body": { "key": { "eldest_kid": "01203c62595f5cca42250889a34ea9645cc433077f5f6c4dde72491cb09fc31be5720a", "host": "keybase.io", "kid": "01203c62595f5cca42250889a34ea9645cc433077f5f6c4dde72491cb09fc31be5720a", "uid": "6c80edd9acf48d06a415dc3a552bd819", "username": "williamsthing" }, "merkle_root": { "ctime": 1537991350, "hash": "086d4cc781f442530d05cec06082bfc6fe13d7e40c3b123ea7e9c340b83359b27be45d37cc158d2d72027a5f33c7782d9c179e6b86f59303ae71bf19bf13bbb7", "hash_meta": "1250a64afbee0fbc3437e5fbd836580f040d54b37290766f705852efe7c28599", "seqno": 3696458 }, "service": { "entropy": "bdf+yzSf12hFVWuJWdpV3giu", "name": "github", "username": "williamsthing"

View gist:5166c5104307a8c19c7d35ad42135356
{
"info" : {
"cardID" : "nxiHW",
"cardCreatedAt" : 1536147650357.0,
"meta" : {
"type" : "splitter"
}
}
},
{
View fizzbuzz.js
for(i = 0; i <= 100; i++){
var output = "";
if(i % 3 == 0){ output += "Fizz"; }
if(i % 5 == 0){ output += "Buzz"; }
if(output == ""){ output = i; }
console.log(output);
}
View gist:5a6c46abd14fe48af4e21a98af17592a
console.log("\"" + "1c2321-7d98a1-5e6572-a9b4c2-eef1ef".split("-").join("\", \"#") + "\"")
View authloginClient-master.js
function Authlogin(args){this.appID=args.appID;this.ab_domain="https://authbase.co";this.getCookie=function(cname){var name=cname+"=";var decodedCookie=decodeURIComponent(document.cookie);var ca=decodedCookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1)}
if(c.indexOf(name)==0){return c.substring(name.length,c.length)}}
return""}
this.makeID=function(len){var text="";var possible="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";for(var i=0;i<len;i++)
text+=possible.charAt(Math.floor(Math.random()*possible.length));return text}
this.setCookie=function(cname,cvalue,exdays){var d=new Date();d.setTime(d.getTime()+(exdays*24*60*60*1000));var expires="expires="+d.toUTCString();document.cookie=cname+"="+cvalue+";"+expires+";path=/"}
this.getLCID=function(){if(this.getCookie("al_lcID")!=""){return this.getCookie("al_lcID")}else{var lcID=this.makeID(15);this.setCookie("al_lcID",lcID,999999);return lcID}}
this.getLSID=function(){if(this.getCookie("al_lsID
@williamsthing
williamsthing / prepForPrinter.js
Last active Apr 19, 2018
A JS function that adds newlines to a string so it doesn't get automatically cut off in the middle of a word, for example.
View prepForPrinter.js
function prepForPrinter(string){
const length = 32;
// The total amount of characters per printing line (yes I had to count them by hand).
var totalLength = 0;
// Keeps a count of the current word length per line, resets on new line
if(string.length > 0){
string = string.split(" ");
for(i = 0; i < string.length; i++){
totalLength += string[i].length + 1;
You can’t perform that action at this time.