Skip to content

Instantly share code, notes, and snippets.

View ifknot's full-sized avatar
💭
Get off my lawn!

ifknot ifknot

💭
Get off my lawn!
View GitHub Profile
@ifknot
ifknot / stopwatch.h
Last active July 4, 2020 14:08
stopwatch iodiom high precision timer for measuring software performance
/**
* @brief stopwatch idiom high precision timer for measuring software performance
* @tparam PolicyClock - std::chrono::steady_clock (default), system_clock, high_resolution_clock
*/
template<typename PolicyClock = std::chrono::steady_clock>
class stopwatch {
using clock_t = PolicyClock;
public:
@reedacartwright
reedacartwright / xorshift64.h
Last active October 18, 2022 01:36
A 64-bit Xorshift PRNG combined a Weyl Generator. Passes all BigCrush tests.
/*******************************************************************************
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,
@gramian
gramian / neotemp
Created March 28, 2017 18:35
Read CPU temperature of Nanopi Neo
#!/bin/sh
echo $((`cat /sys/class/thermal/thermal_zone0/temp` / 1000))
@mik30s
mik30s / webcam_capture.cpp
Last active October 26, 2024 01:20
Simple C++ program to capture a webcam frame in Linux
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <linux/ioctl.h>
#include <linux/types.h>
#include <linux/v4l2-common.h>
#include <linux/v4l2-controls.h>
#include <linux/videodev2.h>
#include <fcntl.h>
#include <unistd.h>
@CoolOppo
CoolOppo / optimal-video-to-gif-imagemagick.md
Last active April 2, 2025 14:11
Converting videos to GIFs optimally using ImageMagick

ImageMagick Video to GIF Optimization Summary

A software developer who uses IM to create Movie GIFs, Benoit Rouleau, in discussion with me, gave me a AVI video of a plane flying over, to help us mutually explore IM video conversion techniques.

@tanayseven
tanayseven / expr.asm
Created October 16, 2012 19:55
8087 assembly level program to evaluate (x+y)(a+b)/(a+b)(x-y), floating point
;8087 program to evaluate (x+y)(a+b)/(a+b)(x-y)
data segment
a dd 3.2
b dd 2.1
x dd 6.3
y dd 7.7
result dd ?
ends data
code segment