Skip to content

Instantly share code, notes, and snippets.

View iamtekeste's full-sized avatar
🕺
having fun with code

Tekeste Gebreanenia iamtekeste

🕺
having fun with code
View GitHub Profile

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
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
@iamtekeste
iamtekeste / 0_reuse_code.js
Last active August 29, 2015 14:07
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
<?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
@iamtekeste
iamtekeste / swap the keybindings for paste and paste_and_indent
Created June 22, 2015 12:33 — forked from twosixcode/gist:1988097
swap the keybindings for paste and paste_and_indent
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }
<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>
@iamtekeste
iamtekeste / drupal-views-share-global-text-field
Last active August 29, 2015 14:26 — forked from chrisjlee/drupal-views-share-global-text-field
share url's for facebook, twitter, pinterest with just get variables
<ul>
<li class="share-text">Share this>/li>
<li class="share-tw"><a href="http://twitter.com/share?text=[title]"><span></span></a></li>
<li class="share-fb"><a href="http://www.facebook.com/sharer.php?u=/node/[nid]&p=[title]"><span></span></a></li>
<li class="share-pinterest"><a href="http://pinterest.com/pin/create/button/?url=/node/[nid]&description=[title]"><span></span></a></li>
</ul>
@iamtekeste
iamtekeste / functions.php
Created October 30, 2015 15:16 — forked from levymetal/direct_parent.php
Custom Wordpress function which uses a nav walker to display a list of child pages from a common parent, which can be called from either the parent page (displays children) or any of the child pages (displays siblings). Detailed instructions available on my blog post here: http://christianvarga.com/how-to-get-submenu-items-from-a-wordpress-menu-…
<?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;
#!/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:
@iamtekeste
iamtekeste / *.md
Created July 4, 2016 18:53 — forked from toddmotto/*.md
How I lost 20kg/3stone/44lbs

Everytime I tweet about losing weight and posting images, a lot of people ask questions - so thought I'd write something decent down about what I've done so far and am currently working on.

12 months change:

Necessary changes

Step 1: Fixing your diet

My diet used to be so so bad, energy drinks, constant sugar intake. Kill that! I also used to order takeaways at least 2-3 times a week, because it was easy and the bigger you get the lazier you get from my experience.