Skip to content

Instantly share code, notes, and snippets.

View Qix-'s full-sized avatar
💻
Making an OS @oro-os

Josh Junon Qix-

💻
Making an OS @oro-os
View GitHub Profile
@Qix-
Qix- / cheat.js
Created October 15, 2017 16:15
Eat the Dots cheat
// just call `play()` when the game has started.
function getCurrentCoords() {
const tiles = document.querySelectorAll('.grid > div');
for (var y = 0; y < 5; y++) {
for (var x = 0; x < 5; x++) {
const i = y * 5 + x;
if (tiles[i].classList.contains('coin')) {
return [x, y];
@Qix-
Qix- / Kirshenbaum.js
Created July 30, 2017 07:18
Kirshenbaum.py ported to Javascript. Doesn't work for eSpeak (yay o-o)
// Credit to coruus and lingz from Github.
// Ported to JS by qix-. I didn't try to reformat - sorry! o-o
// Original work by Evan Kirshenbaum
// http://www.kirshenbaum.net/IPA/
var kirshenbaum = (function () {
var PHONEMIC_RE = /[^\/]+/;
function _sort(it) {
// Sort by reverse-length, then alphabetically
const chalk = require('chalk');
const ignoreChars = /[^!-~]/;
function rainbow(str, offset) {
if (!str || str.length === 0) {
return str;
}
const hueStep = 360 / str.replace(ignoreChars, '').length;
// it's a thousand degrees and I can't sleep, it's thursday,
// i'm feeling saucy and so I decided to make a song out of math.
//
// super, super high def audio (176,400 Hz = HDCD)
//
// to run:
// - install ffmpeg (`brew install ffmpeg` or `apt install ffmpeg`)
// - run (without backticks) `node bouncy-egyptian-song.js | ffplay -f f64le -ar 176400 -`
// ^
// this hyphen is required! > > ^
@Qix-
Qix- / test-distribution.js
Created June 11, 2017 23:36
Tests the distribution of a 0...1 RNG algorithm.
const RNG = require('./lib/rng');
// Returns a number of metrics about a run.
// - `seed` should be any number
// - `runs` should be in the millions or above for best results
// - `slotCount` is the number of buckets (I tend to stick with 100)
// The returned metrics include a "variance" member, which is
// the average deviance from perfect distribution.
// For reference, perfect distribution is (1/slotCount).
@Qix-
Qix- / unicorn.cc
Created May 11, 2017 04:45
This is fine.
#include <iostream>
using namespace std;
int main() {
int lol🦄unicorn = 10;
cout << lol🦄unicorn << endl;
return 0;
}
#include <stdio.h>
#include <string.h>
static const char * LOL =
"you should have expected this to get out of hand, Sindre. 💃😈\n"
"this is almost entirely your fault!! 🙈💩 WY<.< h[+}Q"
"<.< <.< X-*%)1P<.< _QX<.< <.< H18\xC3P0 lol 😐🖖 ball's in your"
"court now. <.<";
int main(void) {
// clang++ -std=c++11 lol.cc -o lol
#include <iostream>
using namespace std;
int main() {
int lol = 10;
int l​ol = 10;
int l​o​l = 10;
int l​​ol = lol + l​ol + l​o​l;
@Qix-
Qix- / command.sh
Created April 29, 2017 03:32 — forked from deepak1556/command.sh
Simple electron app to test pepper plugin load
#!/bin/bash
g++ ./hello.cc -shared -o libppapi_hello.so -I/home/robo/github/nacl_sdk/pepper_43/include -L/home/robo/github/nacl_sdk/pepper_43/lib/linux_host/Release -lppapi_cpp -lppapi -lpthread -Wall -fPIC
@Qix-
Qix- / setup_release.sh
Last active April 9, 2018 04:37
LLVM Release Switcher
#!/usr/bin/env bash
set -e
function log {
echo -e "\x1b[36;1m""$@""\x1b[m"
}
function log2 {
echo -e "\x1b[36;2m""$@""\x1b[m"