Skip to content

Instantly share code, notes, and snippets.

@descubraomundo
descubraomundo / override_config.php
Created July 8, 2014 11:19
Laravel Override Config
// Get config loader
$loader = $this->app['config']->getLoader();
// Get environment name
$env = $this->app['config']->getEnvironment();
// Add package namespace with path set base on your requirement
$loader->addNamespace('basset',__DIR__.'/../config/basset');
// Load package override config file
@descubraomundo
descubraomundo / user_role_filter.php
Created June 28, 2014 14:35
Laravel 4 auth role based page access
Route::filter('role', function()
{
if(Auth::user()->role != 'admin') {
return Redirect::to('home');
}
});
Route::get('protectedPage1', array('before'=>'role', function() {
// do your job
}));
@descubraomundo
descubraomundo / show_hide_spotlight
Created March 26, 2014 13:36
Show / Hide the Spotlight Menu Icon in Mac OS X
#HIDE
sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
killall SystemUIServer
#SHOW
sudo chmod 755 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
killall SystemUIServer
@descubraomundo
descubraomundo / add_spacer.
Created March 19, 2014 13:24
Add spacer to Mac Dock
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
cd /path_to_drupal_installation
chown -R deploy:www-data .
find . -type d -exec chmod u=rwx,g=rx,o=rx {} \;
find . -type f -exec chmod u=rw,g=r,o=r {} \;
@descubraomundo
descubraomundo / css_resources.md
Created February 23, 2014 18:08 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@descubraomundo
descubraomundo / javascript_resources.md
Created February 23, 2014 18:08 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@descubraomundo
descubraomundo / 0_reuse_code.js
Created February 23, 2014 18:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@descubraomundo
descubraomundo / gist:6075467
Created July 24, 2013 23:10
Download / Upload SSH
#Copy something from this system to some other system:
scp /path/to/local/file username@hostname:/path/to/remote/file
#Copy something from some system to some other system:
scp username1@hostname1:/path/to/file username2@hostname2:/path/to/other/file
#Copy something from another system to this system:
scp username@hostname:/path/to/remote/file /path/to/local/file
backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql
restore:# mysql -u root -p[root_password] [database_name] < dumpfilename.sql