Skip to content

Instantly share code, notes, and snippets.

View wadmiraal's full-sized avatar

Wouter Admiraal wadmiraal

View GitHub Profile
@wadmiraal
wadmiraal / ps_aux_sorted.sh
Last active August 29, 2015 14:13
List top programs by number of processes
ps aux | awk '{ print $11 }' | sort | uniq -c | sort -r
@wadmiraal
wadmiraal / Drupal default tabs styles.scss
Last active February 29, 2016 17:46
Drupal default tabs styles. Enhance the default Drupal tabs styles with this little snippet. They look much better.
ul.tabs {
border-bottom: 0;
margin: 20px;
padding: 0;
overflow: hidden;
li {
float: left;
margin-right: .5em;
$('html, body').animate({ scrollTop: $('#some-element').offset().top }, 'slow');
@wadmiraal
wadmiraal / Delay dropped-down menu hide by a few milliseconds.js
Last active February 29, 2016 17:47
Delay dropped-down menu hide by a few milliseconds, instead of just relying on CSS :hover. **Change main selector.**
$(document).ready(function() {
$('#header-main-menu li').hover(function() {
// Stop the timer.
clearTimeout(this.sfTimer);
// Display child lists.
$('> ul', this).css({left: 'auto', display: 'block'})
// Immediately hide nephew lists.
.parent().siblings('li').children('ul').css({left: '-999em', display: 'none'})
}, function() {
// Start the timer.
<?php
/**
* @defgroup group_identifier Topic title goes here
* @{
* Summary line for the group/topic goes here.
*
* Additional documentation paragraphs go here.
*/
<?php
function THEMENAME_preprocess_page(&$variables) {
// Get the entire main menu tree
$main_menu_tree = menu_tree_all_data('main-menu', NULL, 3); // Provide max-depth.
// Add the rendered output to the $main_menu_expanded variable
$variables['main_menu_expanded'] = menu_tree_output($main_menu_tree);
}
@wadmiraal
wadmiraal / css_resources.md
Created November 25, 2013 07:06 — 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

@wadmiraal
wadmiraal / javascript_resources.md
Created November 25, 2013 07:06 — 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
@wadmiraal
wadmiraal / 0_reuse_code.js
Created November 25, 2013 07: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
@wadmiraal
wadmiraal / i_love_wp_sooo_much.php
Last active December 28, 2015 16:59
My first Wordpress plugin.
<?php
$all_functions = get_defined_functions();
$user_functions = $all_functions['user'];
foreach ($user_functions as $function_name) {
if (preg_match('/^wp_/', $function_name)) {
override_function($function_name, '', 'die("Use Drupal.");');
}
}