start new:
tmux
start new with session name:
tmux new -s myname
| <?php | |
| // add hook | |
| add_filter( 'wp_nav_menu_objects', 'my_wp_nav_menu_objects_sub_menu', 10, 2 ); | |
| // filter_hook function to react on sub_menu flag | |
| function my_wp_nav_menu_objects_sub_menu( $sorted_menu_items, $args ) { | |
| if ( isset( $args->sub_menu ) ) { | |
| $root_id = 0; | |
| <a class="cart-contents" href="<?php echo WC()->cart->get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf (_n( '%d item', '%d items', WC()->cart->cart_contents_count ), WC()->cart->cart_contents_count ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a> |
| // swap the keybindings for paste and paste_and_indent | |
| { "keys": ["super+v"], "command": "paste_and_indent" }, | |
| { "keys": ["super+shift+v"], "command": "paste" } |
| <?php | |
| Route::get('protected', array('before' => 'auth|role:admin', function() { | |
| return "Only admins can see this"; | |
| })); | |
| Route::filter('role', function ($role) { | |
| if ( ! Auth::user()->has_role( $role ) ) | |
| { | |
| return Response::error("401"); // not authorized |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| set nocompatible " Disable vi-compatibility | |
| set t_Co=256 | |
| colorscheme xoria256 | |
| set guifont=menlo\ for\ powerline:h16 | |
| set guioptions-=T " Removes top toolbar | |
| set guioptions-=r " Removes right hand scroll bar | |
| set go-=L " Removes left hand scroll bar | |
| set linespace=15 |
| #!/bin/bash | |
| # USAGE: Will create a .tar.gz with CSVs of all tables in schema. | |
| # Configure below and run as root (i.e. the user mysql runs as) | |
| # | |
| # The script will (or should) SELECT * INTO OUTFILE your tables | |
| # and save them into csv files under /tmp dir first, then name them | |
| # like the tables and move them thogether into a directory. Then | |
| # it will tar everything together and chown you the tarball. | |
| # Schema to export: |