Skip to content

Instantly share code, notes, and snippets.

View sumardi's full-sized avatar
🏠
Working from home

Sumardi Shukor sumardi

🏠
Working from home
View GitHub Profile

Uninstall brew package and dependencies

Remove package's dependencies (does not remove package):

brew deps [FORMULA] | xargs brew remove --ignore-dependencies

Remove package:

@sumardi
sumardi / angularjs-providers-explained.md
Created July 10, 2016 04:30 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

data:text/html;charset=utf-8, <title>TextEditor</title> <link rel="shortcut icon" href="http://g.etfv.co/https://docs.google.com"/> <style> html{height: 100%;} body{background: -webkit-linear-gradient(#f0f0f0, #fff); padding: 3%; height: 94%;} .paper { font: normal 12px/1.5 "Lucida Grande", arial, sans-serif; width: 50%; height: 80%; margin: 0 auto; padding: 6px 5px 4px 42px; position: relative; color: #444; line-height: 20px; border: 1px solid #d2d2d2; background: #fff; background: -webkit-gradient(linear, 0 0, 0 100%, from(#d9eaf3), color-stop(4%, #fff)) 0 4px; background: -webkit-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -moz-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -ms-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -o-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; -webkit-background-size: 100% 20px; -moz-background-size: 100% 20px; -ms-background-size: 100% 20px; -o-background-size: 100% 20p
// http://cocoawithlove.com/2009/10/ugly-side-of-blocks-explicit.html has a nice breakdown of the syntax--it helps to think of the ^ as similar to a pointer dereference symbol *
// block typedef:
typedef void(^Block)();
typedef void(^ConditionalBlock)(BOOL);
typedef NSString*(^BlockThatReturnsString)();
typedef NSString*(^ConditionalBlockThatReturnsString)(BOOL);
// block property with typedef:
@sumardi
sumardi / mpnml
Created November 21, 2012 10:32 — forked from romanr/mpnml
Mysql, Php-fpm, Nginx on OSX Mountain Lion
sudo port -v install mysql5-server
sudo -u _mysql mysql_install_db5
# if above command produce this error: ERROR: 1004 Can't create file '/var/tmp/#sqle967_1_0.frm' (errno: 9)
# do this:
# sudo chown -R mysql:mysql /opt/local/var/db/mysql5
# sudo chmod u+rwx,go= /opt/local/var/db/mysql5
# sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql
@sumardi
sumardi / org.php.php-fpm.plist
Created November 20, 2012 09:28
Install Nginx + PHP-fpm + MySQL on Mac OS X Lion 10.7.2
# First install requirements for BREW
# http://mxcl.github.com/homebrew/
# https://github.com/mxcl/homebrew/wiki/installation
# Requirements
# - An Intel CPU 2
# - OS X 10.5 or higher
# - Command Line Tools for Xcode (https://developer.apple.com/downloads)
# or Xcode with X11 (http://itunes.apple.com/us/app/xcode/id448457090)
# - Java Developer Update (https://connect.apple.com/)
@sumardi
sumardi / .gitignore
Last active October 1, 2015 04:17 — forked from ErikEvenson/.gitignore
Xcode 5 .gitignore file
.DS_Store
*.swp
*~.nib
build/
*.pbxuser
*.perspective
*.perspectivev3