On mac:
- Download the latest release.
- Extract the binary and place it in
/usr/local/bin.
On mac:
/usr/local/bin.Here’s how to make animations like this one. It requires intermediate Unix command-line knowledge, to install some tools and to debug if they don’t work. You’ll need these utilities:
curl (or you can translate to wget)convert and montage, part of ImageMagickffmpeg, plus whatever codecsparallel, for iteration that’s nicer than shell for loops or xargszsh for leading 0s in numerical ranges to worknpm scripts are low-level and leverage the actual library you want to use (example: "lint": "eslint ./")package.json is a central place to see what scripts are available (also npm run will list all scripts)"complex-script": "babel-node tools/complex-script.js")npm scripts are more powerful than one might first think (pre/post hooks, passing arguments, config variables, chaining, piping, etc...)| [ | |
| { | |
| "name": "Alberta", | |
| "abbreviation": "AB" | |
| }, | |
| { | |
| "name": "British Columbia", | |
| "abbreviation": "BC" | |
| }, | |
| { |
| // 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
| const axios = require('axios'); // promised based requests - like fetch() | |
| function getCoffee() { | |
| return new Promise(resolve => { | |
| setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
| }); | |
| } |
| /* 0-1 knapsack problem | |
| For an overall introduction to knapsack problem, see https://en.wikipedia.org/wiki/Knapsack_problem | |
| Function name: knapsack | |
| Param: | |
| items: an array of {w: v:} (where 'w' stands for weight, and 'v' stands for value) | |
| capacity: a positive integer number | |
| Will return max sum value that can reach, and the chosen subset to add up to the value. |
In order to use this script, please retrieve client id, client secret and refresh token before. About this, you can see the detail information at https://gist.github.com/tanaikech/d9674f0ead7e3320c5e3184f5d1b05cc.
This is for the simple item upload is available for items with less than 4 MB of content. The detail information is https://dev.onedrive.com/items/upload_put.htm.
var fs = require('fs');
var mime = require('mime');
var request = require('request');There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.
brew install ffmpegapt install ffmpeg