Skip to main content
Jun
02
2015

Clippy pasta

[2/06/2015 11:08:56 pm] ryivhnn: Chrome is pretty good about being up to w3c standards so it ignores a lot of the -webkit- stuff
[2/06/2015 11:09:05 pm] ryivhnn: Safari still needs a bit of help though coz it’s special
[2/06/2015 11:10:45 pm] Darqx: it's just apple
[2/06/2015 11:10:48 pm] Darqx: apple is special
[2/06/2015 11:10:55 pm] Darqx: i am getting so sick of the apple issues at school OTL
[2/06/2015 11:11:42 pm] ryivhnn: LoL
[2/06/2015 11:11:45 pm] Darqx: LIKE MAVERICKS BEING SO SPECIAL THAT APPARENTLY WHEN SOMEONE TELLS IT THEY WANNA LOG OUT IT MEANS "YOU DONT REEEEALLLY WANNA LOGOUT HERE LET ME HELP YOU BY KEEPING SOME OF YOUR PROCESSES OPEN SO TECHNICALLY YOU'RE STILL LOGGED IN"
[2/06/2015 11:11:57 pm] Darqx: it's so annoying
[2/06/2015 11:12:06 pm] ryivhnn: they’ll bring in Clippy soon.  just wait.

Oct
23
2014

Drupal 7 notes - Apache config

/etc/apache2/apache2.conf - find the directory bits and make sure the /var/www one looks like:

<Directory /var/www/> 
  Options Indexes FollowSymLinks 
  AllowOverride All 
  Require all granted 
</Directory>

sudo a2enmod rewrite

 

sudo a2enmod headers

 

Make sure all the site configuration files in /etc/apache2/sites-available have .conf on the end (especially if upgrading from previous Apache and it doesn't seem to be backwards compatible despite what the Linode library says).

Don't forget to sudo a2ensite all-the-sites.conf

Sep
03
2014

Drupal 7 notes - making javascript work in a modal

Or more accurately in my case, making a jquery gallery work inside a modal.  I am really bad at javascript so I have no idea if my hackjob is a good way to do anything but it did what I wanted.

What we needed in a recent project was for a gallery view with a thumbnail slider to launch from a gallery index comprising of thumbnails made up fo the first image in a multiupload image field.  We used Gallery Formatter (the only one that would show up in the Colorbox Node at all).

Showing up was one thing, but the jquery magic wasn't present in the modal.  I got it to work by dropping the following into a file called script.js which lives in a /js folder in my theme.

Jun
27
2014

Drupal 7 notes - getting a Views block with a pager to remember what page it's on

While building this gallery for this client, I ran into an issue where if you clicked on the next page in the navigation block and selected a project on the second page, when the new project loaded the block would reload back on page 1.  The Designer and I thought that pagers really needed to remember what page they were on but as of four years ago it was a feature Views and the core pager didn't support, so at the bottom of an issue someone else opened up four years ago asking for this to happen some kind soul provided this code:

Apr
05
2014

Webmonkey notes - rails command not working after successful rails install

Latest ruby:

sudo brew update sudo brew install ruby

OSX developer command line tool thingies:

xcode-select --install

Read the EULA and agree if you agree.

Latest sass:

sudo gem install sass -V

Rails:

sudo gem install rails -V

Why yes I do like to see what's going on.

Edit ~/.bash_profile to include:

export PATH=/usr/local/Cellar/ruby/2.1.1/bin:$PATH

so that the system doesn't have a cry about Rails not being installed after it just told you it successfully installed it.

Mar
11
2014

Drupal 7 notes - forms with file field reloading page without going through form validation

I had a problem shortly after setting up ownCloud and Piwik where forms on all of the Drupal sites on my server mysteriously stopped working.

But not all of them, only the ones with a file field.  When hitting the submit button on those forms (and it didn't matter what the form was, the presence of a file field was enough) the form validate wouldn't trigger, the page would simply reload.

After much stuffing around and frustration, I found the problem was related to the max filesize and max upload limits in php.ini were set to 2G.  Changed them to a much more managable 100M and all is well with the world.

Moral of the story: don't mess around with php.ini in the middle of the night after not sleeping properly for two weeks.

Mar
03
2014

Webmonkey notes - setting up ssl, Piwik and ownCloud under subdomains on Linode

As per usual part tutorial and mostly notes for me and anything with ridiculous names (e.g. username and domain) means replace with your information.

Ingredients

Nov
28
2013

Have you tried turning it off and then on again?

This morning, when I crawled out of bed and tackled the morning coffee sites to be followed by 3d work before our busy day commenced, I noticed that my server was slow.

There goes my 3d time again, sigh.  Now I would have quickly investigated, if it hadn't taken FOR FREAKING EVER to log into the server, and I had to leave before it had logged in, and unsurprisingly the pipe had broken and annoyingly the problem hadn't resolved itself when I was able to tackle it again later in the day.

Oct
09
2013

Drupal 7 install profile stuff that everyone else magically knows

Seeing as I found little to nothing when searching for how to configure individual role permissions, editor settings and enabling contrib filters with an install profile, I made something on the off-chance it helps some other poor sap like me who doesn't automagically know where to look for these things.

Enabling filters provided by contrib modules

Search in the .module files for _filter_info. Some modules use the same format as Drupal filters of $filters['modulename_filter'], others don't. Typogrify doesn't:

<?php
  function typogrify_filter_info() {
  return array(
    'typogrify' => array(
?>

 

so in the install profile it would look like:

<?php
  // typogrify
  'typogrify' => array(
    'weight' => 0,
    'status' => 1,
  ),
?>

 

whereas Media does:

Feb
05
2013

Drupal 7 notes: node or page template by path

Because I always seem to manage to completely forget how to do something this basic.

template.php in theme_preprocess_page(&$variables) or theme_preprocess_node(&$variables)

<?php
  $path = drupal_get_path_alias();

  if (strpos($path, 'part_of_url') !== false) {
    $variables['theme_hook_suggestion'] = 'page__whatever'; // or node__whatever if using in a node preprocess
  }
?>