Skip to content

Instantly share code, notes, and snippets.

Mavericks & Show Hidden Files
I noticed this because part of my postflight imaging task for my lab systems is to show all files, but in Mavericks, the com.apple.finder defaults domain is case sensitive. So if you have com.apple.Finder you’ll need to edit it in such a workflow. So, for example, if you need to see hidden files, use the following commands:
defaults write com.apple.finder AppleShowAllFiles -boolean true
killall Finder
The problem with seeing hidden files is that you see a lot of stuff that you really probably don’t want to see. So to get back to a state where you don’t have to see all of the invisible files, use the following commands:
defaults delete com.apple.finder AppleShowAllFiles
killall Finder
@TonyWael
TonyWael / oh my zsh ubuntu
Last active December 27, 2015 12:48
oh my zsh ubuntu
Prereq:
apt-get install zsh
apt-get install git-core
Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
and then you change your shell to zsh
chsh -s `which zsh`
@TonyWael
TonyWael / gist:7254611
Created October 31, 2013 18:31
mod_rewrite apache2
//After installing apache2 run this command $sudo a2enmod rewrite
//Add in .htaccess RewriteBase /pathe/to/project/
.htaccess{
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /public_html/
RewriteBase /pathe/to/project/
#RedirectMatch ^/(.*) http://localhost/$1
@TonyWael
TonyWael / Git cheat sheat
Last active December 24, 2015 21:29
Git ubuntu cheatsheat
git
(on branch development)$ git merge master
(resolve any merge conflicts if there are any)
git checkout master
git merge develop (there won't be any conflicts now)

Always forgetting shortcuts.

  • ALT+SHIFT+W To wrap your selected content with a html tag, just selected your text, then press Alt-Shift-W. You'll then have the option to fill in the front and back tag simultaneously. https://coderwall.com/p/d1qphg
  • CMD+L Select current line.
  • CMD+X Delete line.
  • CMD+R Go to method
  • CMD+P ":121" go to specific line number
  • CMD+P file:n go to specific line number in file
  • CMD+P file@method go to specific method in file
  • CMD+SHIFT+D Duplicate current line