-
jq — https://jqlang.org/ — "like sed for JSON data"
There are several options available for installing jq. I prefer to use Homebrew:
brew install jq
This file contains hidden or 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
| Summary | |
| This article provides instructions on setting the hostname of a Mac OS X workstation from the terminal. | |
| This can be useful when configuring your workstation remotely through ssh, or when you need to change the fully qualified hostname of the workstation (which can't be done from the UI). | |
| Note: The following procedure is for informational purposes only and is not an Autodesk certified or supported workflow. Should issues arise with this procedure, they will not be addressed by Autodesk Customer Support. | |
| Procedure | |
| Perform the following tasks to change the workstation hostname using the scutil command. | |
| Open a terminal. |
This file contains hidden or 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/bash | |
| ##################################################### | |
| # Name: Bash CheatSheet for Mac OSX | |
| # | |
| # A little overlook of the Bash basics | |
| # | |
| # Usage: | |
| # | |
| # Author: J. Le Coupanec | |
| # Date: 2014/11/04 |
These examples based on FFmpeg wiki page: How to concatenate (join, merge) media files
brew install ffmpeg
brew upgrade ffmpeg
This file contains hidden or 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
| var outputLocation = require('path').resolve(__dirname, 'file.json'); | |
| require('fs').writeFile(outputLocation, JSON.stringify(data, null, 4), function(err) { | |
| if(err) { | |
| console.log(err); | |
| } else { | |
| console.log("JSON saved to "+outputLocation); | |
| } | |
| }); |
This file contains hidden or 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
| from scrapy.spider import BaseSpider | |
| class MindhacksSpider(BaseSpider): | |
| domain_name = "mindhacks.cn" | |
| start_urls = ["http://mindhacks.cn/"] | |
| def parse(self, response): | |
| return [] | |
| SPIDER = MindhacksSpider() |