Skip to content

Instantly share code, notes, and snippets.

@bouassaba
bouassaba / git_remote_branches_list.sh
Created June 17, 2015 14:00
List Remote Git Branches By Author sorted by committerdate
git for-each-ref --format='%(committerdate) %09 %(authorname) %09 %(refname)' | sort -k5n -k2M -k3n -k4n
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled
@bouassaba
bouassaba / .gitignore
Last active August 29, 2015 14:17 — forked from adamgit/.gitignore
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.3
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@bouassaba
bouassaba / virtualbox_delete_network.sh
Created January 26, 2015 09:18
Virtualbox delete network
ifconfig
VBoxManage hostonlyif remove vboxnet4
@bouassaba
bouassaba / magento_delete_all_nesletter_subscribers.sql
Created January 19, 2015 11:37
magento delete all newsletter subscribers
delete FROM newsletter_subscriber;
@bouassaba
bouassaba / magento_remove_all_customers.sql
Last active August 29, 2015 14:13
magento remove all customers
SET FOREIGN_KEY_CHECKS=0;
-- reset customers
TRUNCATE customer_address_entity;
TRUNCATE customer_address_entity_datetime;
TRUNCATE customer_address_entity_decimal;
TRUNCATE customer_address_entity_int;
TRUNCATE customer_address_entity_text;
TRUNCATE customer_address_entity_varchar;
TRUNCATE customer_entity;
TRUNCATE customer_entity_datetime;

How to enable Gmail notification for Safari 6 in Mountain Lion

If you're like me who uses Safari, and finds Gmail in browser most comfortable to use, you might want to enable notification from Gmail in Safari 6. Notification Center in Mountain Lion does support websites in Safari to send notifications, but by now Gmail does not ask for permission to send notifications. Fortunately Gmail uses html5 notification, which is supported in Safari 6. We can manually request permission from Safari for Gmail.

  1. Enable Develop menu. Safari->Preferences->Advanced: Check "Show Develop menu in menu bar".
  2. Open mail.google.com.
  3. Develop->Show Web Inspector. The console will show at bottom. Paste in following command in the console and press Enter. [1] window.webkitNotifications.requestPermission(function(){alert(window.webkitNotifications.checkPermission());})
  4. If the alert box shows 0, it means mail.google.com successfully gets notification permission. Send yourself an email with a different email addre
@bouassaba
bouassaba / purge_debconf.sh
Created January 15, 2015 14:43
purge debconf
echo purge | debconf-communicate oldpackage
@bouassaba
bouassaba / mysql_dump_pretty_filename_and_gzip.sh
Created January 13, 2015 11:07
MySQL db dump with pretty filename and gzip
mysqldump -u root -p mydbname | gzip > amapur_`date +%Y_%m_%d_%H_%M_%S`.sql.gz
@bouassaba
bouassaba / git_pretty_log.sh
Created January 10, 2015 11:12
Git pretty log
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"