Skip to content

Instantly share code, notes, and snippets.

View kkirby's full-sized avatar

Kyle Kirbatski kkirby

View GitHub Profile
@kkirby
kkirby / hung.m
Last active October 11, 2023 06:19
Updated NonResponding
/**
* compile using this:
* gcc -framework Carbon -framework Foundation ./hung.m -o hung
*
* Referenced from https://apple.stackexchange.com/a/424763/260619
* Original source code https://github.com/jksoegaard/NonResponding
* Original Author: jksoegaard
**/
#import <Foundation/Foundation.h>
@kkirby
kkirby / README.md
Last active September 10, 2020 21:15
PegJS NETSCAPE Bookmark file parser

This is a simple parser used with PegJS to parse a NETSCAPE-Bookmark-file. I've only tested this with safari export.

You have to remove these tags:

<HTML>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<Title>Bookmarks</Title>
<H1>Bookmarks</H1>
</HTML>
@kkirby
kkirby / hsvToRgb.php
Last active March 31, 2020 22:57
PHP version of HSL to RGB
<?php
// Original Credit goes to:
// Paul S. @ StackOverflow https://stackoverflow.com/a/17243070
// This has been converted from JavaScript.
//
// I was unable to find a pre-made solution in PHP that worked correct.
// Specifically: HSL(360,87,87)
function HSV_TO_RGB($h, $s, $v) {
$i = floor($h * 6);
$f = $h * 6 - $i;
@kkirby
kkirby / App.js
Created September 18, 2019 18:30
import clients from './clients';
/**
* Start command:
* env REACT_NATIVE_APP_CLIENT=ge react-native start
* Bundle Command
* react-native bundle --reset-cache --bundle-output ./output.js --entry-file ./index.js
**/
console.log(
package cc.openframeworks;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
import android.app.Activity;
import android.view.Surface;
import android.content.Context;
@kkirby
kkirby / # weechat - 2018-08-07_12-24-58.txt
Created August 7, 2018 18:16
weechat on macOS 10.13.6 - Homebrew build logs
Homebrew build logs for weechat on macOS 10.13.6
Build date: 2018-08-07 12:24:58
@kkirby
kkirby / amazonsmile.user.js
Last active April 23, 2018 03:35
Amazon Smile Script
// ==UserScript==
// @name amazon smile
// @namespace http://aploiki.com
// @version 0.1
// @description Autoswitch to amazon smile.
// @author Kyle
// @match *://*.amazon.com/*
// @match *://amazon.com/*
// @grant none
// @run-at document-start
#include <map>
#include <string>
#include <iostream>
#include <regex>
#include <math.h>
typedef enum {PX,CH,CW,VH,VW} unitsize_t;
struct SizeInfo {
unitsize_t unit;
#include "JavaClass.h"
size_t allocations;
map<int,JavaClass*> JavaClass::instances;
JavaClass::JavaClass(const char* inputJavaClassName): javaClassName(inputJavaClassName), refid(allocations++) {
JavaClass::instances.insert(std::pair<int,JavaClass*>(refid,this));
JNIEnv *env = ofGetJNIEnv();
jclass clazz = getJavaClass();
link(){
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ \
-arch i386 \
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk \
-L/Users/kkirbatski/Downloads/OpenRCT2/build \
-L/usr/local/lib/Debug \
-L/usr/local/lib \
-L/usr/local/Cellar/jansson/2.7/lib/Debug \
-L/usr/local/Cellar/jansson/2.7/lib \
-F/Users/kkirbatski/Downloads/OpenRCT2/build \