Skip to content

Instantly share code, notes, and snippets.

@IceCreamYou
IceCreamYou / JS Log Periodically
Created December 15, 2012 02:35
A JavaScript function to log messages to the console periodically.
/**
* Periodically log a message to the JavaScript console.
*
* This is useful for logging things in loops; it avoids being overwhelmed by
* an unstoppable barrage of similar log messages. Example calls:
*
* # Log "message" to the console no more than every 500ms.
* logPeriodically('message', 500);
* # Log "message" as an error no more than every 500ms.
* logPeriodically('message', 500, console.error);
@sora
sora / Makefile
Created September 16, 2012 07:15
Lattice Diamond: command-line build
BOARD_DIR=../rtl
CORES_DIR=../../../cores
BOARD_NAME="LatticeECP3"
DEVICE_NAME="LFE3-35EA"
PKG_NAME="FPBGA484"
PER_GRADE=8
SEARCH_PATH="/usr/local/diamond/2.0/ispfpga/ep5c00/data"
include common.mak
@clauswitt
clauswitt / distance.js
Created January 13, 2012 07:11
Get the distance between two (world) coordinates - a nodejs module
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* */
/* Simple node js module to get distance between two coordinates. */
/* */
/* Code transformed from Chris Veness example code - please refer to his website for licensing */
/* questions. */
/* */
/* */
/* Latitude/longitude spherical geodesy formulae & scripts (c) Chris Veness 2002-2011 */
/* - www.movable-type.co.uk/scripts/latlong.html */