Skip to content

Instantly share code, notes, and snippets.

View grant-h's full-sized avatar

Grant Hernandez grant-h

View GitHub Profile
@grant-h
grant-h / gcc-static.min.sh
Created May 22, 2015 04:57
Statically linking .o files with gcc
#!/bin/sh
set -e
cat > libtest.c <<EOF
#include <stdio.h>
void test_function(int arg)
{
printf("Calling test_function(%d)\n", arg);
@grant-h
grant-h / gist:761d753011b8df8ec417
Created March 5, 2015 15:38
Git Aliases (git sl)
[alias]
br = branch
co = checkout
ci = commit
di = diff
st = status
sl = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all --since='90 days ago'
summary = show # Mercurial crib
@grant-h
grant-h / hello.c
Last active August 2, 2022 06:12
A 400 byte, alternative "Hello world!"
// Run with gcc -o hello hello.c && ./hello
// An alternative "Hello World!" By DigitalCold
#include<unistd.h>
#include<errno.h>
main(){char*s=&errno,
*a=s,*t="@?>=",*z=t,
h[]={12,29,7,0,3,177,
87,-8,3,-6,-8,189,233,
1};for(;*z;s--){for(
;access(s,0),*a==14;