Skip to content

Instantly share code, notes, and snippets.

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@jpattishall
jpattishall / TouchTimerWorkaround.js
Last active September 1, 2022 07:58
setTimeout workaround for iPad and iOS6
/**
Workaround for iOS 6 setTimeout bug using requestAnimationFrame to simulate timers during Touch/Gesture-based events
Author: Jack Pattishall (jpattishall@gmail.com)
This code is free to use anywhere (MIT, etc.)
Note: UIWebView does not support requestAnimationFrames. If your timer is failing during a scroll event,
take a look at https://gist.github.com/ronkorving/3755461 for a potential workaround.
Usage: Pass TRUE as the final argument for setTimeout or setInterval.
@zhongwen
zhongwen / eudist_sse.cc
Created November 2, 2012 18:25
Euclidean distance with SSE
static inline float euclidean_baseline_float(const int n, const float* x, const float* y){
float result = 0.f;
for(int i = 0; i < n; ++i){
const float num = x[i] - y[i];
result += num * num;
}
return result;
}
static inline float euclidean_intrinsic_float(int n, const float* x, const float* y){