This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
Copyright (C) 2009-2017 Reed A. Cartwright, PhD <[email protected]> | |
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstring> | |
#include <cstdint> | |
#include <cstdio> | |
uint8_t pack_a(const char *cs) { | |
uint32_t u; | |
memcpy(&u,cs,4); | |
u &= 0x06060606; | |
u = (u | (u << 6) | (u << 12) | (u << 18)) >> 19; | |
return u; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "License": Public Domain | |
// I, Mathias Panzenböck, place this file hereby into the public domain. Use it at your own risk for whatever you like. | |
// In case there are jurisdictions that don't support putting things in the public domain you can also consider it to | |
// be "dual licensed" under the BSD, MIT and Apache licenses, if you want to. This code is trivial anyway. Consider it | |
// an example on how to get the endian conversion functions on different platforms. | |
#ifndef PORTABLE_ENDIAN_H__ | |
#define PORTABLE_ENDIAN_H__ | |
#if (defined(_WIN16) || defined(_WIN32) || defined(_WIN64)) && !defined(__WINDOWS__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Taken from https://github.com/reedacartwright/shell-config | |
# | |
# The following commands will produce a prompt that includes the error code of the | |
# last command run if it is not zero. E.g. | |
# [user@host dir $?=123]$ | |
# If the user is not root, the prompt is green, except the error information which is red. | |
# If the user is root, the prompt is read, except the error information which is green. | |
# If the last commend exited with a 0, then the prompt looks normal. E.g. | |
# [user@host dir]$ | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Copyright (c) 2014-2015 Reed A. Cartwright <[email protected]> | |
# Copyright (c) 2014-2015 Alberto Villa <[email protected]> | |
# Copyright (c) 2015 Mike Clarke <[email protected]> | |
# | |
# This script determines the revision number used to build FreeBSD packages | |
# and syncs a local ports directory to match it. | |
# | |
# USAGE: sync-ports [name or abs_path] | |
# |
NewerOlder