Skip to content

Instantly share code, notes, and snippets.

@yoggy
yoggy / SerialPort.cpp
Created August 11, 2012 10:58
SerialPort class sample using boost::asio::serial_port
#include "StdAfx.h"
#include <Setupapi.h>
#pragma comment(lib, "Setupapi.lib")
#include "SerialPort.h"
SerialPort::SerialPort(void) : end_of_line_char_('\n')
{
}
@kwk
kwk / CMakeLists.txt
Last active February 14, 2024 08:53
Fix for "undefined reference to dlopen" in CMake projects
project(testlink)
add_executable(testlink main.cpp)
target_link_libraries(testlink)
@aras-p
aras-p / preprocessor_fun.h
Last active July 16, 2024 02:50
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@winterz
winterz / setup-travis.sh
Last active May 25, 2017 01:10
travis CI setup script
#/bin/sh -f
# things to do for travis-ci in the before_install section
if ( test "`uname -s`" = "Darwin" )
then
#cmake v2.8.12 is installed on the Mac workers now
#brew update
#brew install cmake
echo
@dferg
dferg / howto-tomato-install-entware.markdown
Last active January 22, 2024 04:40
HOWTO: Install entware on Shibby TomatoUSB

Introduction

This howto describes installing entware for the Tomato open-source router firmware.

Requirements

  • USB stick - 1G or more in size
  • USB-capable router running TomatoUSB.

This Howto Was Tested With

@ChrisAichinger
ChrisAichinger / angle_helpers.py
Created June 14, 2016 05:16
Functions for working with angles
import math
def average_angles(angles):
"""Average (mean) of angles
Return the average of an input sequence of angles. The result is between
``0`` and ``2 * math.pi``.
If the average is not defined (e.g. ``average_angles([0, math.pi]))``,
@uebayasi
uebayasi / openwrt-x86_64-nfs-root.md
Last active September 29, 2020 03:46
Mount root as NFS on OpenWrt x86_64

Summary

  • Not much info available but surely possible
  • Basically same as normal Linux NFS root
  • Except kernel configuration adjustment might be tricky

Environment

  • Target: OpenWrt 15.x on KVM
  • Host Ubuntu 16.04
@ryankurte
ryankurte / hardfault.c
Last active October 8, 2017 16:00
Cortex M Hardfault Handler
// A HardFault handler to make life easier when debugging
// See http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0553a/Cihcfefj.html
// The smol version
void HardFault_Handler(void) {
SCB_Type* scb = SCB;
(void*)scb;
__asm("BKPT #0");
while(1);
}