Skip to content

Instantly share code, notes, and snippets.

@psxdev
psxdev / gist:3261e5376cc5745c8f37e6ff3f9fae6b
Created June 17, 2018 12:02
basic sample liborbis compliant
/*
* liborbis sample
* Copyright (C) 2015,2016,2017,2018 Antonio Jose Ramos Marquez (aka bigboss) @psxdev on twitter
* Repository https://github.com/psxdev/liborbis
*/
#include <stdio.h>
#include <stdlib.h>
@bijanebrahimi
bijanebrahimi / cross-compiler.sh
Last active April 17, 2024 19:54
build a linux cross compiler for FreeBSD targets
#!/bin/bash
export TARGET=amd64-marcel-freebsd9.2
export PREFIX=/usr/cross-build
export TARGET_PREFIX=$PREFIX/$TARGET
export PATH=$PATH:$PREFIX/bin
mkdir -p $TARGET_PREFIX{,/lib,/include}
mkdir build-{binutils,gmp,mpfr,mpci,gcc}
@lukas-h
lukas-h / license-badges.md
Last active May 1, 2024 10:20
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@tjs-w
tjs-w / tcpmd5_server6.c
Created January 5, 2016 23:11
TCP_MD5SIG socketopt in Linux
/**
* tcpmd5_server6.c: TCP_MD5SIG
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
@cfstras
cfstras / -Build static versions of binutils, for example ld, gprof, nm, strip, objdump, ar, strings; with mingw or on *nix
Last active March 29, 2024 09:25
Build static versions of binutils, for example ld, gprof, nm, strip, objdump, ar, strings; with mingw or on *nix
See the bash script below. :)
Tested on debian bookworm-slim (`docker pull debian:bookworm-slim`).
### Prerequisites
```bash
apt update
apt install -y build-essential wget bison
```
@17twenty
17twenty / simple_git.md
Created September 27, 2013 18:32
A Simple Git branching model

a simple git branching model

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

The gist

@sudar
sudar / url-encode.c
Created August 20, 2012 14:59
URLEncoding in C
int c;
char *hex = "0123456789abcdef";
while( (c = getchar()) != EOF ){
if( ('a' <= c && c <= 'z')
|| ('A' <= c && c <= 'Z')
|| ('0' <= c && c <= '9') ){
putchar(c);
} else {
putchar('%');
@martani
martani / pollard-rho.c
Created December 21, 2011 00:22
Pollard's rho factoring method
/*
* pollard-rho.c
* Created on: Dec 20, 2011
* Author: martani
*/
#include <stdlib.h>
#include <stdio.h>
#include <gmp.h>
@rsms
rsms / 00-README.md
Last active September 22, 2021 14:10
Example programs and tests for the POSIX Asynchronous file I/O

There are some tests ripped out from git://repo.or.cz/ltp-debian.git/testcases/open_posix_testsuite/conformance/interfaces and made self-containing. They demonstrate and can be used to test the POSIX AIO interface for asynchronous I/O and formerly file IO.

Build with a c compiler (for instance clang or cc):

cc -o aio_read-test aio_read-test.c && ./aio_read-test

Note: Contrary to popular belief, it has been tested and confirmed to actually be asynchronous on Darwin 10.6.0 (xnu 1504.9.26~3).