This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function time_diff(date1, date2) { | |
var future_date, past_date; | |
date1 < date2 ? (past_date = date1, future_date = date2) | |
: (past_date = date2, future_date = date1); | |
var D = {}, | |
t = future_date - past_date, | |
SECOND = 1000, | |
MINUTE = 6e4, | |
HOUR = 36e5, // 60 minutes | |
DAY = 864e5, // 24 hours |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Find the latest version of this script here: | |
// https://gist.github.com/rsms/a8ad736ba3d448100577de2b88e826de | |
// | |
const EM = 2048 | |
interface FontInfo { | |
familyName :string | |
styleName :string | |
unitsPerEm :int | |
ascender :int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eo pipefail | |
SOCKFILE="$HOME/Library/Application Support/Playbit/vconsole0.sock" | |
while [ $# -gt 0 ]; do case "$1" in | |
-h|-help|--help) cat <<END | |
Connect a terminal to Playbit | |
Usage: $0 [--help | <sockfile>] | |
<sockfile> defaults to $SOCKFILE |
- https://github.com/rsms/move (2011)
- https://github.com/rsms/hue (2012)
- https://github.com/rsms/sol (2012)
- https://github.com/rsms/lum (2013)
- https://github.com/rsms/saturate (2013)
- https://github.com/rsms/rxlang (2014)
- https://github.com/rsms/coxlang (2016)
- https://github.com/rsms/co (2017)
By Don Libes
Originally appeared in the Nov. 1990 "C User's Journal" and is also reprinted as Chapter 35 of "Obfuscated C and Other Mysteries", John Wiley & Sons, 1993, ISBN 0-471-57805-3. http://www.wiley.com/compbooks/m3.html.
This column will describe a set of functions to implement software
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Figma project stats | |
// Pulls statistics like number of files, frames, versions etc for a project. | |
// | |
// Usage: | |
// export FIGMA_API_ACCESS_TOKEN='your-token' | |
// node figma-project-stats.js <project-id> | |
// | |
// You can generate tokens in your account settings or at | |
// https://www.figma.com/developers/explorer#personal-access-token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Make sure you have imagemagick installed (`brew install imagemagick` on macos) | |
// 2. Visit https://www.figma.com/developers/api#authentication and click "Get personal access token" | |
// 3. Add your file links below, replacing the example links | |
// 4. Run with `FIGMA_API_TOKEN=YOUR_TOKEN_FROM_STEP_2_HERE node fig-thumbnails.js` | |
// [ host:string, filekey:string ][] | |
const fileKeys = ` | |
https://www.figma.com/file/FILEKEY/ | |
https://staging.figma.com/file/FILEKEY/ | |
https://www.figma.com/file/FILEKEY/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cc -std=c11 miniast.c -o miniast && ./miniast | |
#include "xcommon.h" | |
ASSUME_NONNULL_BEGIN | |
typedef enum AKind { | |
AKindInt, // 123 | |
AKindAdd, // + | |
AKindSub, // - | |
AKindMul, // * | |
} AKind; |
NewerOlder