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- / header-check.c
Created January 2, 2016 03:55
NES Header Checker
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ines-header.h"
#define max(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })
@Qix-
Qix- / topng.sh
Last active January 30, 2016 10:36
Convert anything to PNG
#!/bin/sh
SIZE=$(wc -c "$1" | awk '{print $1}')
SQUARE=$(bc <<< "sqrt( $SIZE / 3 ) + 1")
TOTAL=$(expr $SQUARE "*" $SQUARE "*" 3)
PAD=$(expr $TOTAL - $SIZE)
dd if=/dev/zero ibs=1 count=$PAD 2>/dev/null | cat $1 - | convert -size ${SQUARE}x${SQUARE} -depth 8 rgb:- -scale 200% $2
@Qix-
Qix- / keybase.md
Created February 13, 2016 21:51
keybase.md

Keybase proof

I hereby claim:

  • I am Qix- on github.
  • I am qix (https://keybase.io/qix) on keybase.
  • I have a public key whose fingerprint is D5F8 6047 E9CF DD53 6588 3F5D 03A0 B7D0 432E 1514

To claim this, I am signing this object:

/*
this quick and dirty example shows how a program can
mount a new table as the global table, run some code,
restore the original global table and then refer to the
'child' global table as a regular ol' table in the parent
global's scope.
expected output:
global
type id 0
@Qix-
Qix- / skinnify.cc
Created April 15, 2016 04:07
Skinnify
#include <iostream>
#include <string>
#include <deque>
using namespace std;
int main(int argc, char **argv) {
if (argc < 2) return 1;
int backsize = atoi(argv[1]);
deque<string> backlog(backsize, "");
cout << string(backsize, '\n');
string line;
@Qix-
Qix- / dstat.c
Created April 29, 2016 06:51
dstat - developer stat
#include <sys/stat.h>
#include <stdio.h>
int main(int argc, char **argv) {
if (argc != 2) {
fprintf(stderr, "error: must specify (only) one file\n");
return -1;
}
struct stat attr;
@Qix-
Qix- / portal-console.js
Created September 18, 2014 22:47
Portal Fish Recipe Console
'use strict';
var injectables = [
"ingredients",
"for the cake",
"1 2/3 cups all-purpose flour",
"1 1/2 cups granulated sugar",
"2/3 cup unsweetened cocoa powder",
"1 1/2 teaspoons baking soda",
"1 teaspoon salt",
@Qix-
Qix- / palette.php
Last active April 9, 2017 15:19
PHP Palette (Color manipulation)
<?php
/**
* Palette Library
*
* A simple class that wraps color modification operations
* into a simple and elegant chainable clas
*/
class Palette
{
@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
// 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;