Skip to content

Instantly share code, notes, and snippets.

View Unifex's full-sized avatar

Gold Unifex

  • Ackama
  • Wellington, New Zealand
View GitHub Profile
@Unifex
Unifex / HTMLsnippet
Created July 7, 2014 08:54
I was wanting to have a Bootstrap/Bootswatch well with a background image instead of dropping the image inside, using css to jam it in in the right shape (rounded corners, etc) and trying to overlay the content in that. This was how I got around it. I suspect there's a better way of doing it (especially something with responsive images) but it's…
<div class="well well-lg" data-well-bg="path/to/image">
Content and stuff.
</div>

Keybase proof

I hereby claim:

  • I am unifex on github.
  • I am unifex (https://keybase.io/unifex) on keybase.
  • I have a public key whose fingerprint is F1D4 3D57 CB3F C6AF AF0A 7B2C E086 029D 4F37 645D

To claim this, I am signing this object:

@Unifex
Unifex / Homeopathy for chronic asthma.md
Created October 14, 2015 22:37
A response to @homeopathynatho about checking Cochrane for support for homeopathy

Response to homeopathynatho

Homeopathic remedies (potencies) aim to minimise the risk of adverse effects. There are different types that may be used for asthma, such as classical homeopathy (tailored to an individual’s symptoms) or isopathy (for example using a dilution of an agent that causes an allergy, such as pollen). The review of trials found that the type of homeopathy varied between the studies, that the study designs used in the trials were varied and that no strong evidence existed that usual forms of homeopathy for asthma are effective. There has been only a limited attempt to measure a ‘package of care’ effect (i.e., the effect of the medication as well as the consultation, which is considered a vital part of individualised homeopathic practice). **Until stronger evidence exists for the use of homeopathy in the treatment o

@Unifex
Unifex / No evidence that homeopathy is effective in treating dementia.md
Created October 14, 2015 22:38
A response to @homeopathynatho about checking Cochrane for support for homeopathy

Response to homeopathynatho

Dementia is a distressing illness that has major implications for individuals with the disease and their carers. Homeopathy is a popular type of complementary medicine. It is however controversial because although there is some evidence that it is not just a placebo, no one understands how it could work. The researchers did not find any good quality trials and so cannot say whether it is or is not effective for treating this condition. As no information is available on how much homeopathy is used for dementia, it is difficult to say whether it is important to conduct more trials.

@Unifex
Unifex / Homeopathy for ADHD.md
Created October 14, 2015 22:40
A response to @homeopathynatho about checking Cochrane for support for homeopathy

Response to homeopathynatho

This review aimed to assess the evidence for homeopathy as an intervention for attention deficit/hyperactivity disorder. Four trials were retrieved and assessed with mixed results. Overall the results of this review found no evidence of effectiveness for homeopathy for the global symptoms, core symptoms or related outcomes of attention deficit/hyperactivity disorder.

@Unifex
Unifex / Homeopathic medicines for adverse effects of cancer treatments.md
Created October 14, 2015 22:43
A response to @homeopathynatho about checking Cochrane for support for homeopathy

Response to homeopathynatho

This review looked at whether these [homeopathic] medicines could help patients with problems caused by cancer treatments […] Two studies with low risk of bias demonstrated benefit: one with 254 participants demonstrated benefits from calendula ointment in the prevention of radiotherapy-induced dermatitis, and another with 32 participants demonstrated benefits from Traumeel S (a complex homeopathic medicine) […] These trials need replicating. Two other studies reported positive results, although the risk of bias was unclear, and four further studies reported negative results. […].

@Unifex
Unifex / Homoeopathy for induction of labour.md
Created October 14, 2015 22:45
A response to @homeopathynatho about checking Cochrane for support for homeopathy
@Unifex
Unifex / gist:7db225da0cb406b3d9b00c70b44b5103
Last active May 31, 2016 22:38
Drupal 7 has a reasonably messed up way of handling menus and I was unable to find a simple way of saying "starting here give me 2 levels of menu." This does that for you. It returns an array of menu items. If you've set depth to anything greater than 0 it will append these and an array to the `children` key. No authentication or validation is p…
/**
* Helper funtion to get an array of menu items and children.
*
* This returns an array of menu items with child menu items added to the
* 'children' key.
*
* @param int $mlid
* The menu link ID we are looking at.
* @param int $depth
* How deep do you want to go?
@Unifex
Unifex / gist:bd5f650b604d3695e94746be62b6e3aa
Created June 1, 2016 22:08
I do a lot of prototyping on the command line with drush. This allowed me to test switching content types. It's very bare bones but it's a good place to start.
drush ev '
$query = new EntityFieldQuery;
print_r($query);
$result = $query->entityCondition("entity_type", "node")
->propertyCondition("type", "morning_message")
->execute();
print_r($result);
foreach ($result['node'] as $row) {
print_r($row);
$node = node_load($row->nid);
@Unifex
Unifex / template.php
Created August 17, 2016 00:55
Drupal 7: Find when a node is first published. This uses workbench moderation.
<?php
/**
* Implements hook_preprocess_node().
*/
function my_module_preprocess_node(&$variables) {
$node = $variables['node'];
// First published.
// This query uses workbench moderation to determine the first moderation
// transition that resulted in a published node and takes the timestamp
// from that record.