Skip to content

Instantly share code, notes, and snippets.

View grota's full-sized avatar

Giuseppe Rota grota

  • SparkFabrik
  • Getares, Spain
View GitHub Profile
@grota
grota / Ergodox config, take one
Created August 3, 2014 16:23
Ergodox config, take one
Layer 0:
,--------------------------------------------------. ,--------------------------------------------------.
| `~ | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | -_ | =+ | \| |
|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
| Tab | Q | F | W | R | Y | Home | | End | '" | H | J | K | L | RGui |
|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
| | A | S | D | G/L1 | T |------| |------| P | C | E | O | I | RShift |
|--------+------+------+------+------+------| | | ;: |------+------+------+------+------+--------|
| LShift | Z | X | M | B |V/Shft| | | | U | N | ,< | Up | .> | RCtrl |
`--------+------+------+------+------+-------------' `-------------+------+--
@grota
grota / debug_drupal_queries
Created August 3, 2013 08:35
Debug Drupal EntityFieldQuery and Views Queries
/**
* Implements hook_query_alter
*/
function modulename_query_alter($query) {
if ($query->hasTag('debug') && module_exists('devel')) {
dpm(strtr((string) $query, $query->getArguments()));
}
}
/* When using an EntityFieldQuery */
@grota
grota / question.md
Created December 26, 2012 10:23
Question regarding the absence of documentation for `public_methods` in RMI

I'm a ruby newbie, and I was wondering why there was no html generated documentation for the public_methods method defined in class.c in RMI.

The rdoc comments seem to be present in the class.c file, but there's no trace of them in the html output.

The same thing happens to me locally when I generate the html with rvm docs generate.

It's not only an issue for public_methods but also for methods, protected_methods, private_methods, singleton_methods, basically all the methods that have obj. in the rdoc comment.
Are those methods deprecated by any chance?

@grota
grota / gist:1276427
Created October 10, 2011 20:31
Easier buffer navigation, to review
" Easy buffer navigation, the following:
" http://vim.wikia.com/wiki/Avoid_scrolling_when_switch_buffers
" does not work because the events BufLeave,BufEnter are called
" before the <C-w>|<C-w>_ commands
function Savewinpos()
let b:winview = winsaveview()
endfunc
function RestoreWinPos()
if(exists('b:winview')) | call winrestview(b:winview) | endif
endfunc