Skip to content

Instantly share code, notes, and snippets.

@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active June 4, 2024 04:16
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@nickkraakman
nickkraakman / ffmpeg-cheatsheet.md
Last active April 23, 2024 20:53
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
pair = 'BTCUSD'
csv = [['Date', 'Open', 'High', 'Low', 'Close', 'Volume']]
end_t = Time.now.to_i * 1000
loop do
body = HTTParty.get("https://api.bitfinex.com/v2/candles/trade:1h:t#{pair}/hist?_bfx=1&limit=1500&end="+end_t.to_s).body
body = Oj.load(body) rescue nil
break if body.nil?
break if body.size == 0
body.each do |e|
csv << [Time.at(e[0] / 1000).strftime('%Y-%m-%d %H:00:00'), e[1], e[3], e[4], e[2], e[5]]