Skip to content

Instantly share code, notes, and snippets.

@waako
waako / gist:8560329
Created January 22, 2014 15:10
checkout file/folder from remote repository and overwrite local file/folder
git checkout origin/master folder-or-file
@waako
waako / book
Created January 30, 2014 16:49
I am writing to you because we are looking for someone to develop a book of around 300-320 pages on Drupal 8 Theme Development Hotshot. By the end of this book the reader would have experienced and developed various Drupal themes for different business and personal needs through 10-11 different projects.
The target audience will be Drupal developers, designers and consultants who want to develop and design their own themes using Drupal.
Taken into consideration that you have previously authored a book on similar technology, I was wondering if you would be interested in authoring this book as well. So, if authoring this book for Packt is something you’d be interested in, or if you have any questions, please do get in touch.
@waako
waako / lists.css
Created February 13, 2014 14:01
beurgh!
#content div.afm li ul, #content div.afm li ol {
margin: 0 !important;
}
#content div.afm h1, #content div.afm h2, #content div.afm h3, #content div.afm h4, #content div.afm h5, #content div.afm h6, #content div.afm p, #content div.afm ol, #content div.afm ul, #content div.afm blockquote {
background-color: rgba(0, 0, 0, 0) !important;
background-image: none !important;
border: 0 none !important;
box-shadow: 0 0 0 #FFFFFF !important;
color: #333333 !important;
margin: 15px 0 !important;
@waako
waako / node--type--teaser.tpl.php
Created March 11, 2014 08:45
Content type Teaser node template
function hamilton_trust_preprocess_node(&$variables) {
$variables['theme_hook_suggestions'][] = 'node__' . $variables['type'] . '__' . $variables['view_mode'];
}
<?php
/**
* Implements hook_preprocess_HOOK().
*
*/
function MYTHEME_preprocess_html(&$vars) {
// Fixes page titles for login, register & password.
switch (current_path()) {
case 'user':
$vars['head_title_array']['title'] = t('Login');
@waako
waako / regex
Created March 31, 2014 18:23
swap out less for sass
1. replace @ with $
Find: @
Replace: $
2. replace mixins
Find: \.([\w\-]*)\s*\((.*)\)\s*\{
Replace: @mixin \1\(\2\)\n{
3. replace includes
Find: \.([\w\-]*\(.*\)\s*;)
@waako
waako / alter.php
Created April 8, 2014 09:32
Hide/Change User Edit Profile form fields
<?php
/**
* Implements hook_form_user_profile_form_alter()
*
**/
function hamilton_trust_form_user_profile_form_alter(&$form, &$form_state, $form_id) {
unset($form['field_user_fieldname']);
}

#Local PHP Dev Environment

###Set up Apache

Uncomment this line in: /etc/apache2/httpd.conf

#Include /private/etc/apache2/extra/httpd-vhosts.conf

Paste this into: /etc/apache2/extra/httpd-vhosts.conf

<?php
/**
* @file
* menu-link.func.php
*/
/**
* Overrides theme_menu_link().
*/
function bootstrap_theme_menu_link(array $variables) {
{
"bold_folder_labels": true,
"caret_style": "wide",
"color_scheme": "Packages/Decent Color Scheme/Samuel's decent.tmTheme",
"default_line_ending": "unix",
"dictionary": "Packages/Language - English/en_GB.dic",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"fallback_encoding": "UTF-8",