Skip to content

Instantly share code, notes, and snippets.

View johnsonjh's full-sized avatar
💥
CPE1704TKS

Jeffrey H. Johnson johnsonjh

💥
CPE1704TKS
  • BAN AI Systems
  • https://keybase.io/trnsz
View GitHub Profile
@MikeRalphson
MikeRalphson / gzcompat.c
Created November 11, 2009 18:16
Quasijarus strong compression conversion utility
#ifndef lint
static char sccsid[] = "@(#)gzcompat.c 5.2 (Berkeley) 12/21/00";
#endif
/* gzcompat converts between compress -s and gzip formats. */
#include <stdio.h>
char magic_strong[2] = {037, 0241};
char magic_gzip[2] = {037, 0213};
@emk
emk / rpctest.c
Created April 22, 2011 17:43
XML-RPC for C code snippet (revision 1.10 of xmlrpc_data.c and 1.23 of rpctest.c, from ~10 years ago)
/* Copyright (C) 2001 by First Peer, Inc. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
@mooware
mooware / gnu-libc-print-stacktrace.c
Last active April 25, 2024 12:29
Print a stacktrace on Linux with GNU libc
// this code fragment shows how to print a stack trace (to stderr)
// on Linux using the functions provided by the GNU libc
#include <execinfo.h>
#define MAX_STACK_LEVELS 50
// helper-function to print the current stack trace
void print_stacktrace()
{
#! /usr/bin/env python
import fileinput
import argparse
from operator import itemgetter
parser = argparse.ArgumentParser()
parser.add_argument('--target-mb', action = 'store', dest = 'target_mb', default = 61000, type = int)
parser.add_argument('vmtouch_output_file', action = 'store', nargs = '+')
args = parser.parse_args()
@brianjriddle
brianjriddle / git-checkout-date.sh
Created January 31, 2012 06:36
git checkout source code to a specific date
git checkout "`git rev-list master -n 1 --first-parent --before=2008-03-02`"
@mojca
mojca / aquaterm.rb
Created June 1, 2012 11:50
AquaTerm recipe for Homebrew
require 'formula'
class Aquaterm < Formula
homepage 'https://github.com/AquaTerm/AquaTerm'
url 'https://github.com/AquaTerm/AquaTerm/tarball/tempv1.1.1a'
md5 'a91bd7c6fc188fb33d2f1684eed600fd'
version '1.1.1'
head 'https://github.com/AquaTerm/AquaTerm.git', :using => :git
@Coneko
Coneko / gist:4234842
Created December 7, 2012 17:24
How to get your code to run on different cores in OSX / iOS without CHUD.
#import <pthread.h>
#import <mach/thread_act.h>
// These two functions are declared in mach/thread_policy.h, but are commented out.
// They are documented here: https://developer.apple.com/library/mac/#releasenotes/Performance/RN-AffinityAPI/_index.html
kern_return_t thread_policy_set(
thread_t thread,
thread_policy_flavor_t flavor,
thread_policy_t policy_info,
mach_msg_type_number_t count);
@hubgit
hubgit / README.md
Last active June 14, 2024 17:40
Remove metadata from a PDF file, using exiftool and qpdf. Note that embedded objects may still contain metadata.

Anonymising PDFs

PDF metadata

Metadata in PDF files can be stored in at least two places:

  • the Info Dictionary, a limited set of key/value pairs
  • XMP packets, which contain RDF statements expressed as XML

PDF files

@pascalpoitras
pascalpoitras / config.md
Last active July 18, 2024 22:34
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@EinfachToll
EinfachToll / vwtags.py
Created February 18, 2014 14:04
Vimwiki Tagbar integration
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Put this file anywhere and add the following to your .vimrc.
# The value of ctagsargs must be one of 'default', 'markdown' or 'media'.
#
# let g:tagbar_type_vimwiki = {
# \ 'ctagstype':'vimwiki'
# \ , 'kinds':['h:header']
# \ , 'sro':'&&&'