Skip to content

Instantly share code, notes, and snippets.

View radiofreejohn's full-sized avatar
🤓

John radiofreejohn

🤓
  • Goldsky
  • Raleigh, NC
View GitHub Profile
@radiofreejohn
radiofreejohn / check-frag.c
Created January 20, 2012 02:00
check individual files for fragmentation on Mac OS X
/*
check-frag filename [blocksize guess]
blocksize default is 4096 -- smaller and seeks take too long
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/fcntl.h>
#include <unistd.h>
@radiofreejohn
radiofreejohn / nv3h_read_gz.c
Created January 11, 2012 02:12
IDL dlm to read formatted ASCII files
/*
* gcc nv3h_read_gz.c -shared -Bsymbolic -I/zshare/rsi/idl_6.3/external/include -L/zshare/rsi/idl_6.3/bin/bin.linux.x86_64 -lidl -o nv3h_read_gz.so -fPIC -lz -ldl
*
* requires zlib 1.2.5 for gzbuffer -- will check for right version
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <zlib.h>
@radiofreejohn
radiofreejohn / itob.c
Created July 23, 2011 06:04
integer to binary string
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
char *itob(char *buffer, int x)
{
unsigned int z = INT_MAX + 1U;
char *buf = buffer;
do
@sanxiyn
sanxiyn / lisp.c
Created August 14, 2010 04:16
Lisp
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
enum type {
NIL,