Skip to content

Instantly share code, notes, and snippets.

@bramblex
bramblex / abu.sh
Last active March 16, 2017 14:03
#!/bin/bash
function __main__(){
BACKUP_DIR=${HOME}/.autobackup
local op=${1}
shift
case ${op} in
"init")
init ${@}

OS X 屏幕录制视频转 GIF 动画

本篇文章告诉你如何在 Mac OS X 上用免费的工具来将屏幕录制视频转成 GIF 动画, 这些免费的工具是: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

步骤

首先, 使用系统自带的 "QuickTime Player" 程序来录制屏幕:

@dflemstr
dflemstr / example.cpp
Last active September 15, 2022 00:31
A C++ implementation of fixed point math
#include "fixedp.h"
#include <iostream>
int main(int, char **)
{
fixedp<true, 16, 16> x(0); //32-bit signed 16.16 fixed-point number
fixedp<false, 8, 8> y(10); //16-bit unsigned 8.8 fixed-point number
std::cout << (fixedp<false, 4, 4>(3.5) + fixedp<false, 4, 4>(4.5)).toFloat() << std::endl;
//prints "8"