Skip to content

Commit

Permalink
standardizze contributing guidelines
Browse files Browse the repository at this point in the history
Updated the code to use
* sh code blocks for commands
* console code blocks for script outputs

Also updated the contributing guidelines to first run make install and then run make lint.
  • Loading branch information
kamleshkc2002 authored and simeg committed Jul 6, 2020
1 parent 6e9b719 commit e27cb7d
Show file tree
Hide file tree
Showing 42 changed files with 481 additions and 255 deletions.
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Contributions to macOS Setup Guide are more than welcome.
By contributing code to macOS Setup Guide, you agree to license your
contribution under the [MIT License](../LICENSE).

## Linting
## Installing dependencies and linting

Run `make lint` before submitting your PR to make sure your changes comply
Run `make intall` first to make sure all the dependencies are installed in the workspace. Then run `make lint` before submitting your PR to make sure your changes comply
with our styling.

## How to contribute to macOS Setup Guide
Expand Down
2 changes: 1 addition & 1 deletion .github/CONTRIBUTION_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<!--
How to install it. If it's available on Homebrew, just include the following:
```bash
```sh
$ brew install <tool>
```
-->
Expand Down
22 changes: 16 additions & 6 deletions Apps/Octave.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,41 @@ As this distributes a compiled version of Octave, installation will be much fast

To [install using homebrew-cask](https://octave-app.org/#installing-with-homebrew-cask) run:

brew tap octave-app/octave-app
brew cask install octave-app
```sh
brew tap octave-app/octave-app
brew cask install octave-app
```

### Homebrew official

You can also install Octave from the official Homebrew source using the method below.

Install `octave` from core Homebrew (which is available by default):

brew install octave
```sh
brew install octave
```

**Note**: If `brew` complains about not having a formula for Octave, the following command should fix it:

brew tap --repair
```sh
brew tap --repair
```

The command below upgrades Octave and its dependencies to the latest Homebrew-supported versions:

brew update && brew upgrade
```sh
brew update && brew upgrade
```

Octave has many dependencies which will be downloaded and installed prior to Octave. **The entire installation process can take a few hours if you are compiling from source.**

**Note:** On Snow Leopard or earlier, Octave requires an X server. You can download one from the [XQuartz project](https://www.xquartz.org/).

You might find that you need to add:

setenv ("GNUTERM", "X11")
```sh
setenv ("GNUTERM", "X11")
```

to your octaverc file, normally located at `/usr/local/share/octave/site/m/startup`.
14 changes: 7 additions & 7 deletions BashCompletion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ key. This will help you when writing the bash command in terminal.

## Installation

```bash
```sh
brew install bash-completion
```

Bash completion will be installed in `/usr/local/etc/bash_completion.d`.

For it to work, add this to your `~/.bash_profile`:

```bash
```sh
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion
```

Or simply type:

```bash
```sh
echo "[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion" >> ~/.bash_profile
```

Restart your bash session:

```bash
```sh
source ~/.bash_profile
```

Expand All @@ -35,7 +35,7 @@ source ~/.bash_profile
Once you've done this, you can use bash completion by pressing the tab key
twice after a command. For example:

```bash
```sh
$ git [tab] [tab]
add blame cherry-pick config format-patch gui merge push repack rm stage whatchanged
am branch citool describe fsck help mergetool range-diff replace send-email stash worktree
Expand All @@ -48,13 +48,13 @@ bisect cherry commit fetch grep log

You can list additional completion packages are available by typing:

```bash
```sh
brew search completion
```

And you can install them using `brew install` commands, for example:

```bash
```sh
brew install docker-completion
```

Expand Down
14 changes: 9 additions & 5 deletions Cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

Make sure you have installed [Xcode command line tools](http://sourabhbajaj.com/mac-setup/Xcode/). Check the C++ version to make sure it is Clang 4.0+.

$ c++ --version
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
```console
$ c++ --version
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
```

To be able to compile files from your terminal you can add the following alias in your `env.sh` file.

alias cppcompile='c++ -std=c++11 -stdlib=libc++'
```sh
alias cppcompile='c++ -std=c++11 -stdlib=libc++'
```

Then you can run all cpp file directly using `cppcompile main.cpp` and it will use C++11 so no errors in the case of using vectors, auto, sets etc.
2 changes: 0 additions & 2 deletions Docker/TipsAndTricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,3 @@ docker inspect [CONTAINER ID] | grep -wm1 IPAddress | cut -d '"' -f 4
```sh
docker kill $(docker ps -q)
```

Got more tips and tricks? Submit a PR!
31 changes: 16 additions & 15 deletions Emacs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,27 @@ Many useful features are built with Emacs Mac Port, e.g. environment variables,

Link the Homebrew tap first.

```shell
```sh
brew tap railwaycat/emacsmacport
```

* Method 1: Install with `brew cask`.

```shell
brew cask install emacs-mac
```
```sh
brew cask install emacs-mac
```

There are three available versions, `emacs-mac`, `emacs-mac-official-icon`, `emacs-mac-spacemacs-icon`.

* Method 2: Install using `brew`.

```shell
brew install emacs-mac [options]
```
```sh
brew install emacs-mac [options]
```

<details>
<summary>Click here to see available options: </summary>
<summary>Click here to see available options: </summary>

1. <code>--with-dbus</code>, Build with d-bus support<br>
2. <code>--with-modules</code>, Build with dynamic modules support<br>
3. <code>--with-xml2</code>, Build with libxml2 support<br>
Expand All @@ -50,27 +51,27 @@ brew tap railwaycat/emacsmacport

Start off by tapping the official emacs-plus cask.

```shell
```sh
brew tap d12frosted/emacs-plus
```

Emacs Plus contains separate formulas for different Emacs versions:

* emacs-plus - installs Emacs 26, current release version.

```shell
```sh
brew install emacs-plus [options]
```

* emacs-plus@27 - installs Emacs 27, next release version.

```shell
```sh
brew install emacs-plus@27 [options]
```

* emacs-plus@28 - installs Emacs 28, development version.

```shell
```sh
brew install emacs-plus@28 [options]
```

Expand Down Expand Up @@ -109,7 +110,7 @@ Spacemacs can be used naturally by both Emacs and Vim users -- you can even mix

1. If you have an existing Emacs configuration, back it up first:

```sh
```console
cd ~
mv .emacs.d .emacs.d.bak
mv .emacs .emacs.bak
Expand Down Expand Up @@ -158,7 +159,7 @@ This is [Purcell's](https://github.com/purcell/emacs.d) emacs configuration tree

To install, clone this repository to `~/.emacs.d`, i.e. ensure that the `init.el` contained in this repository ends up at `~/.emacs.d/init.el`:

```shell
```sh
git clone https://github.com/purcell/emacs.d.git ~/.emacs.d
```

Expand All @@ -170,7 +171,7 @@ Upon starting up Emacs for the first time, further third-party packages will be

### Installation

```shell
```console
git clone https://github.com/hlissner/doom-emacs ~/.emacs.d
cd ~/.emacs.d
cp init.example.el init.el # maybe edit init.el
Expand Down
2 changes: 1 addition & 1 deletion Git/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ eval "$(ssh-agent -s)"

If you're running macOS Sierra 10.12.2 or later, you will need to modify your `~/.ssh/config` file to automatically load keys into the ssh-agent and store passphrases in your keychain:

```keychain
```sh
Host *
AddKeysToAgent yes
UseKeychain yes
Expand Down
6 changes: 3 additions & 3 deletions Git/gitignore.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Create the file `~/.gitignore` as shown below

```gitignore
```sh
# Folder view configuration files
.DS_Store
Desktop.ini
Expand All @@ -29,7 +29,7 @@ node_modules

followed by running the command below, in terminal:

```bash
```sh
git config --global core.excludesfile ~/.gitignore
```

Expand All @@ -39,7 +39,7 @@ Or simply download [macOS specific .gitignore](https://github.com/github/gitigno

>**Note**: You can also download it using curl
>```bash
>```sh
>curl https://raw.githubusercontent.com/github/gitignore/master/Global/macOS.gitignore -o ~/.gitignore
>```
Expand Down
4 changes: 2 additions & 2 deletions Go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func main() {

Run the program by running:

```sh
```console
$ go run hello.go
Hello World!
```
Expand All @@ -64,7 +64,7 @@ go install .

Since you have `$GOPATH/bin` added to your `$PATH`, you can run your program from anywhere:

```sh
```console
$ hello
Hello World!
```
Expand Down
36 changes: 24 additions & 12 deletions Heroku/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,55 @@

## Installation

Assuming that you have an Heroku account ([sign up](https://signup.heroku.com) if you don't), let's install the [Heroku Client](https://devcenter.heroku.com/articles/using-the-cli) for the command-line using Homebrew.
Assuming you have a Heroku account ([sign up](https://signup.heroku.com) if you don't), let's install the [Heroku Client](https://devcenter.heroku.com/articles/using-the-cli) for the command-line using Homebrew.

brew install heroku/brew/heroku
```sh
brew install heroku/brew/heroku
```

The formula might not have the latest version of the Heroku Client, which is updated pretty often. Let's update it now:

heroku update
```sh
heroku update
```

Don't be afraid to run `heroku update` every now and then to always have the most recent version.

## Setup

Login to your Heroku account using your email and password:

heroku login
```sh
heroku login
```

If this is a new account, and since you don't already have a public **SSH key** in your `~/.ssh` directory, it will offer to create one for you. It will also upload the key to your Heroku account, which will allow you to deploy apps from this computer.

If it didn't offer create the SSH key for you (i.e. your Heroku account already has SSH keys associated with it), you can do so manually by running:

mkdir ~/.ssh
ssh-keygen -t rsa
```sh
mkdir ~/.ssh
ssh-keygen -t rsa
```

Keep the default file name and skip the passphrase by just hitting Enter both times. Then, add the key to your Heroku account:

heroku keys:add
```sh
heroku keys:add
```

## Usage

Once your keys are in place and you are authorized, you're ready to deploy apps. Heroku has a [getting started guide](https://devcenter.heroku.com/articles/python), which has all the information you need (the one linked here is for Python, but there is one for every popular language). Heroku uses Git to push code for deployment, so make sure your app is under Git version control.

A cheat sheet for deployment:

cd myapp/
heroku create myapp
git push heroku master
heroku ps
heroku logs -t
```console
$ cd myapp/
$ heroku create myapp
$ git push heroku master
$ heroku ps
$ heroku logs -t
```

The [Heroku Dev Center](https://devcenter.heroku.com/) is where you will find more information.
Loading

0 comments on commit e27cb7d

Please sign in to comment.