Skip to content

Instantly share code, notes, and snippets.

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
@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)
@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 / 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`
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
Installing PEAR on OSX 10.9 Mavericks and OSX10.8/10.7
PEAR is a poplular PHP package manager, it doesn't come by default on OSX, how to install PEAR on OSX 10.9 Mavericks and earlier versions of OSX.
Check if you have it
pear version
If not, move into:
cd /usr/local
@TonyWael
TonyWael / gist:7372954
Created November 8, 2013 15:47
Xdebug php
How to run Xdebug on Mac OSX using MAMP
1 Start MAMP
2 Edit php.ini template file through MAMP to enable the extension. Edit the template file via File -> Edit Template -> PHP -> PHP [php version you are using] php.ini
edit php.ini template for mamp on mac osx
3 Edit bottom of php.ini template file so that it ends up looking like if you want profile output
[xdebug]
zend_extension="/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = "/tmp"
; DONT REMOVE: MAMP PRO php5.3.6.ini template compatibility version: 1
@TonyWael
TonyWael / README.md
Created November 26, 2013 09:44 — forked from mikedfunk/README.md

This uses Twitter Bootstrap classes for CodeIgniter pagination.

Drop this file into application/config.

@TonyWael
TonyWael / svn and git together
Created December 6, 2013 15:16
git commit back to svn awesome
http://linux.die.net/man/1/git-svn
git svn clone http://yoursvnserver/svn --username vcsjones
#make some changes
git add -A
#stage your changes. add -A stages all changes;
#you can stage individial files too or use git add -i for interactive adding
git commit -m "My commit messages"