Skip to content

Instantly share code, notes, and snippets.

View didlix's full-sized avatar

Rachel Graves didlix

View GitHub Profile
@didlix
didlix / gist:1424088
Created December 2, 2011 17:29 — forked from maartenJacobs/gist:1424084
Viewing of content type restriction
<?php
/**
* Implements hook_menu_alter().
*/
function module_menu_alter(&$items) {
$old_callback = $items['node/%node']['access callback'];
$old_args = $items['node/%node']['access arguments'];
// Overrides the access callback to remove access to note content
$items['node/%node']['access callback'] = '_note_node_view_access';
@didlix
didlix / gist:2169718
Created March 23, 2012 11:20
Having fun with arrays in php 5.4
<?php
$slide_one = array(1,2,3);
$slide_two = array(
'cat' => array('cute', 'hairy'),
'dog' => array('noisy', 'bark bark')
);
17:27:09 Nick Murdoch: where's unserialise() coming from?
17:27:43 Rachel Graves: unserialize() is just in php, remember, not really OO
17:27:52 Nick Murdoch: ah, okay
17:28:05 Nick Murdoch: ALso no namespacess
17:28:14 Nick Murdoch: And yet people still call PHP a language.
17:28:17 Nick Murdoch: *ducks*
17:28:25 Rachel Graves: lol
17:28:28 Rachel Graves: Look
17:28:30 Rachel Graves: I like OO
17:28:32 Rachel Graves: I like Ruby
@didlix
didlix / multimarkdown.patch
Created March 20, 2013 16:05
Jekyll patched to have multimarkdown support
diff --git a/lib/jekyll.rb b/lib/jekyll.rb
index b0401b9..26936e6 100644
--- a/lib/jekyll.rb
+++ b/lib/jekyll.rb
@@ -66,7 +66,7 @@ module Jekyll
'future' => true, # remove and make true just default
'pygments' => true, # remove and make true just default
- 'markdown' => 'maruku',
+ 'markdown' => 'multimarkdown',
it 'vomits (raises an InvalidOutline) at a yaml_hash with missing paramaters' do
missing_outline_is_a_big_no_no_hash =
{ 'start_date': 'Yesterday',
'body': "You can't begin yesterday",
'title': 'The impossible outline'
# OMG NO OUTLINE!!!
}
expect { Outline.new(missing_outline_is_a_big_no_no_hash) }.to raise_error(Outline::InvalidOutline)
@didlix
didlix / gist:7199063
Created October 28, 2013 15:37
Save game for candybox2
bool candiesThrownGotChocolateBar=false, bool candyBoxBoxOpened=false, bool castleBigRoomHovenHappy=false, bool castleRoom2LitFire=false, bool castleRoom2TookObject=false, bool castleTowerFirstVisitDone=false, bool castleTowerPStoneDone=false, bool castleTowerLStoneDone=false, bool castleTowerAStoneDone=false, bool castleTowerYStoneDone=false, bool castleTowerTookTalkingCandy=false, bool castleKilledNougatMonster=false, bool cellarDone=true, bool dragonDone=false, bool dragonUnlockedCyclops=false, bool forgeFoundLollipop=true, bool forgeBoughtWoodenSword=true, bool forgeBoughtIronAxe=false, bool forgeBoughtPolishedSilverSword=false, bool forgeBoughtLightweightBodyArmour=false, bool forgeBoughtScythe=false, bool fortressRoom1ChestFound=false, bool fortressRoom3ChestFound=false, bool fourthHouseFoundLollipopOnCupboard=true, bool gameDebug=false, bool gameInvertedColors=true, bool lighthousePuzzleDone=false, bool lollipopFarmPlant1LollipopButtonUnlocked=false, bool lollipopFarmPlant10LollipopsButtonUnlocked=fals
@didlix
didlix / forums.rb
Last active August 29, 2015 14:05
an idea for a ruby forums dsl
class Admins do
include Users
include Forums::UserTemplate
def all
Users.admins.all.to_h
end
end
group :admin do
@didlix
didlix / gender.rb
Created October 28, 2014 15:33
Literally coding social expectations
it { should allow_value('male').for(:gender) }
it { should allow_value('female').for(:gender) }
it { should_not allow_value('').for(:gender) }
it { should_not allow_value('other').for(:gender) }
it { should allow_value(nil).for(:gender) }
@didlix
didlix / consumerism.feature
Created November 9, 2014 21:22
Idea for a website to help people see who supports who in the world of corporations and political parties
As an ethical consumer
I want to submit a list of brands I don't want to support
So that I can see a list of owners, subsidiaries and associates who I also should not support
As a left-wing political supporter
I want to submit a list of political parties I do not wish to support
So that I can see a list of companies and people who donate to these parties
As a knowledgeable person
I want to submit details about political parties, brands and companies