Skip to content

Instantly share code, notes, and snippets.

@tattali
Last active June 11, 2018 20:53
Show Gist options
  • Save tattali/5290712d12082c65b3235f3b91f5c481 to your computer and use it in GitHub Desktop.
Save tattali/5290712d12082c65b3235f3b91f5c481 to your computer and use it in GitHub Desktop.
macOS Sierra config

CONFIG

Shortcuts

Delete all files named ".DS_Store" in current directory and subdirectories

$ find . -name ".DS_Store" -delete

OS X proper install

http://www.macplanete.com/tutoriels/23239/installation-propre-macos-sierra-10-12

Bootable USB key macOS Sierra

sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/SierraInstaller --applicationpath /Applications/Install\ macOS\ Sierra.app --nointeraction &&say Done

OS X Preferences

# Show all hidden files
$ defaults write com.apple.finder AppleShowAllFiles YES; killall Finder

App Store

XCode

# XCode Command line tools
$ xcode-select --install

Homebrew

Install

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Usage

$ brew doctor
$ brew update
$ brew upgrade

Packages

$ brew cask install iterm2 sublime-text
$ brew install zsh zsh-completions

# Adding "/usr/local/bin/zsh" into /etc/shells
$ subl /etc/shells
$ chsh -s /usr/local/bin/zsh

# After install MySQL
$ brew cask install sequel-pro

$ brew cask install the-unarchiver vlc firefox avira-antivirus steam nordvpn molotov cheatsheet google-chrome onyx dropbox aegisub handbrake whatsapp skype

# Quick Look plugins : https://github.com/sindresorhus/quick-look-plugins#quick-look-plugins-
$ brew cask install qlcolorcode qlstephen qlmarkdown quicklook-json qlprettypatch quicklook-csv betterzipql qlimagesize webpquicklook

Get a local web development environment

composer

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

PHP

Install the latest PHP version

# Install PHP 7.0
brew install php70 --with-apache
# Save PATH in .zshrc
echo 'export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"' >> ~/.zshrc

Coolest Guides On The Planet : Get Apache, MySQL and PHP

# Add a "theoattali.conf" file
subl /etc/apache2/users/theoattali.conf

Put this content into it

<Directory "/Users/theoattali/Sites/">
    AllowOverride All
    Options Indexes MultiViews FollowSymLinks
    Require all granted
</Directory>

Set permissions

sudo chmod 644 theoattali.conf

In httpd.conf and allow modules

subl /etc/apache2/httpd.conf

Verify that the following modules are uncommented

LoadModule authz_host_module libexec/apache2/mod_authz_host.so
LoadModule authz_core_module libexec/apache2/mod_authz_core.so
LoadModule include_module libexec/apache2/mod_include.so
LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
LoadModule php7_module /usr/local/lib/libphp7.so

Include /private/etc/apache2/extra/httpd-userdir.conf

Only for URL Rewriting...

# Line 259 in httpd.conf macOS Sierra default file
AllowOverride All

subl /etc/apache2/extra/httpd-userdir.conf

# Uncomment
Include /private/etc/apache2/users/*.conf

Git

.gitconfig

[user]
    name = Théo Attali
    email = theoattali@gmail.com
[push]
    default = simple
[color]
    ui = auto
[core]
    excludesfile = /Users/theoattali/.gitignore_global
[alias]
    lga = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
    co = checkout
    st = status

.gitignore_global

# OS X files
._*
.DS_Store
.DS_Store?
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

GitWeb

LoadModule cgi_module libexec/apache2/mod_cgi.so
$ sudo chmod 777 /Library/WebServer/CGI-Executables/gitweb/gitweb.cgi

diff

83c83
< our $projectroot = "/Users/theoattali/Sites/WIP";
---
> our $projectroot = "/pub/git";
87c87
< our $project_maxdepth = 4;
---
> our $project_maxdepth = 2007;
110c110
< our @stylesheets = ("/static/gitweb.css");
---
> our @stylesheets = ("static/gitweb.css");
114c114
< our $logo = "/static/git-logo.png";
---
> our $logo = "static/git-logo.png";
116c116
< our $favicon = "/static/git-favicon.png";
---
> our $favicon = "static/git-favicon.png";
118c118
< our $javascript = "/static/gitweb.js";
---
> our $javascript = "static/gitweb.js";

.vimrc

runtime! config/**/*.vim

set nocompatible

colorscheme desert
syntax enable

set tabstop=4
set softtabstop=4
set expandtab
set number
set showcmd
set cursorline

filetype indent on

set wildmenu

set lazyredraw
set showmatch

set incsearch
set hlsearch

set foldmethod=indent

.zshrc

# https://github.com/robbyrussell/oh-my-zsh/blob/master/lib/history.zsh

# Created by newuser for 5.5.1
export PATH="/usr/local/mysql/bin:$PATH"

## Command history configuration
if [ -z "$HISTFILE" ]; then
    HISTFILE=$HOME/.zsh_history
fi

HISTSIZE=10000
SAVEHIST=10000

# Show history
case $HIST_STAMPS in
  "mm/dd/yyyy") alias history='fc -fl 1' ;;
  "dd.mm.yyyy") alias history='fc -El 1' ;;
  "yyyy-mm-dd") alias history='fc -il 1' ;;
  *) alias history='fc -l 1' ;;
esac

setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space
setopt hist_verify
setopt inc_append_history
setopt share_history # share command history data

# Make sure that the terminal is in application mode when zle is active, since
# only then values from $terminfo are valid
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
  function zle-line-init() {
    echoti smkx
  }
  function zle-line-finish() {
    echoti rmkx
  }
  zle -N zle-line-init
  zle -N zle-line-finish
fi

# start typing + [Up-Arrow] - fuzzy find history forward
if [[ "${terminfo[kcuu1]}" != "" ]]; then
  autoload -U up-line-or-beginning-search
  zle -N up-line-or-beginning-search
  bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search
fi
# start typing + [Down-Arrow] - fuzzy find history backward
if [[ "${terminfo[kcud1]}" != "" ]]; then
  autoload -U down-line-or-beginning-search
  zle -N down-line-or-beginning-search
  bindkey "${terminfo[kcud1]}" down-line-or-beginning-search
fi

Sublime Text

Preferences.sublime-settings

{
    "rulers": [80],
    "tab_size": 4,
    "translate_tabs_to_spaces": true,
    "word_wrap": false,
    "draw_minimap_border": true,
    "highlight_line": true,
    "scroll_past_end": true,
    "draw_white_space": "all",
    "trim_trailing_white_space_on_save": true,
    "ensure_newline_at_eof_on_save": true,
    "shift_tab_unindent": true,
    "highlight_modified_tabs": true,
    "show_encoding": true,
    "show_line_endings": true
}

SublimeText - Packages

import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
  • ApacheConf.tmLanguage
  • Package Control
  • PHP-Twig
  • Sass

Firefox

Zoom

browser.gesture.pinch.in => cmd_fullZoomReduce
browser.gesture.pinch.in.shift => cmd_fullZoomReset
browser.gesture.pinch.latched => false
browser.gesture.pinch.out => cmd_fullZoomEnlarge
browser.gesture.pinch.out.shift => cmd_fullZoomReset
browser.gesture.pinch.threshold => 50

Header Rest

application/x-www-form-urlencoded

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment