Skip to content

Instantly share code, notes, and snippets.


John T. Saxon sacko87

View GitHub Profile
View utf8.c
#include "utf8.h"
#include <errno.h>
isutf8(const unsigned char *string)
int nbytes;
unsigned char *ptr = (unsigned char *) string;
while(*ptr) {
nbytes = 1;
View utf16.c
#include "utf16.h"
#include <errno.h>
isutf16(const unsigned char* string)
uint16_t W1, W2;
unsigned char *ptr = (unsigned char*) string;
while((W1 = *((uint16_t*) ptr)) != 0x0L) {
if(W1 < 0xd800 || W1 > 0xdfff) {
sacko87 / aria.2.html
Created May 11, 2014
Another example of ARIA without the buttons, instead attaching the events to the div.
View aria.2.html
<!doctype html>
<meta charset="utf-8" />
<title>WAI-ARIA Test</title>
<div role="application" aria-controls="p1" class="ctrl" tabindex="0" aria-describedby="i1">
<p id="p1" role="alert" aria-live="assertive">i am text.</p>
<div id="i1">
sacko87 / aria.html
Created May 11, 2014
A quick example of ARIA.
View aria.html
<!doctype html>
<meta charset="utf-8" />
<title>WAI-ARIA Test</title>
<div role="application" tabindex="0">
<p id="i1" role="alert" aria-live="assertive">i am text.</p>
<ul role="navgation">
sacko87 / signal.c
Last active Dec 17, 2015
Signal Handling in C $ gcc -Wall -Werror -pedantic -o signal signal.c
View signal.c
#include <stdio.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>
#include <execinfo.h>
#ifndef ACTION
View draft.tex
% draft stuffs
\newcommand\refcount{\todo{This document contains \total{citnum}\ references.}}

Keybase proof

I hereby claim:

  • I am sacko87 on github.
  • I am sacko87 ( on keybase.
  • I have a public key ASCNXDKnG-FEgladOQoSvdWNqLIXPlVGhVEN4UVVSFoRXgo

To claim this, I am signing this object:

sacko87 / allocate.f95
Last active Aug 16, 2017
Consolidating my fortran knowledge into to one easily manageable Gist.
View allocate.f95
program allocate
implicit none
! an allocatable array of integers
integer, allocatable :: numbers(:)
! some variables
integer :: n, err, i = 0
! how many elements?
n = howmany()
sacko87 / Makefile
Created Aug 11, 2012
IPC Sender and Receiver Example
View Makefile
# the compiler to use
CC =gcc
# flags to send to the compiler
CFLAGS = -O2 -Wall
# executable names
# compile the message queue programs
View worker.go
package main
import (
type Job struct {
source int