Skip to content

Instantly share code, notes, and snippets.

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active November 5, 2024 18:44
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:

@devarajchidambaram
devarajchidambaram / spawn vs child_process
Created August 28, 2018 13:32
Difference between spawn and exec functions of child_process
Difference between spawn and exec functions of child_process
The Node.js Child Processes module (child_process) has two functions spawn and exec, using which we can start a child process to execute other programs on the system. Those new to child_process may wonder why there are two functions to do the same thing, and which one they should use. I'll explain the differences between spawn and exec to help you decide when to use what.
The most significant difference between child_process.spawn and child_process.exec is in what they return - spawn returns a stream and exec returns a buffer.
child_process.spawn returns an object with stdout and stderr streams. You can tap on the stdout stream to read data that the child process sends back to Node. stdout being a stream has the "data", "end", and other events that streams have. spawn is best used to when you want the child process to return a large amount of data to Node - image processing, reading binary data etc.
child_process.spawn is "asynchronously asynchr
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active November 17, 2024 16:44
set -e, -u, -o, -x pipefail explanation
This file has been truncated, but you can view the full file.
--------- beginning of system
05-11 19:48:47.991 1641 1641 I vold : Vold 3.0 (the awakening) firing up
05-11 19:48:47.991 1641 1641 D vold : Detected support for: ext4 f2fs vfat
05-11 19:48:47.994 1641 1641 D vold : Found unmanaged dm device named vendor
05-11 19:48:47.994 1641 1641 D vold : Found unmanaged dm device named system
05-11 19:48:47.994 1641 1641 D vold : Found unmanaged dm device named system-verity
05-11 19:48:47.994 1641 1641 W vold : Failed to LOOP_GET_STATUS64 /dev/block/loop5: No such device or address
05-11 19:48:47.994 1641 1641 W vold : Failed to LOOP_GET_STATUS64 /dev/block/loop3: No such device or address
05-11 19:48:47.994 1641 1641 W vold : Failed to LOOP_GET_STATUS64 /dev/block/loop7: No such device or address
05-11 19:48:47.994 1641 1641 W vold : Failed to LOOP_GET_STATUS64 /dev/block/loop0: No such device or address