Skip to content

Instantly share code, notes, and snippets.

@andymantell
andymantell / conduct-usage.js
Created September 25, 2014 12:00
conduct.js basic usage
conduct(
{
'media_queries':
[
{
query: 'max-width: 600px',
match: function() {
// This code will run when this media query moves from an unmatched state to a matched state
},
unmatch: function() {
@andymantell
andymantell / foo.install
Created September 25, 2014 11:10
Drupal update hook to modify block settings
<?php
/**
* Enable the login form block
*/
function foo_update_7097() {
_block_rehash('theme_name_here');
db_merge('block')
->key(array(
@andymantell
andymantell / deployment.php
Last active April 2, 2016 14:54
Quick and dirty wordpress deployment plugin
<?php
/*
Plugin Name: Deployment routines
Description: Runs update routines allowing code based database updates.
Author: Andy Mantell
Version: 1.0
*/
add_action('admin_init', 'deployment_admin_init');
@andymantell
andymantell / Foo.sublime-project
Last active December 16, 2015 01:09
Per project Sublime Text settings
{
"folders": [
{
"path": "www"
}
],
"settings": {
"rulers": [120],
"tab_size": 2,
"translate_tabs_to_spaces": true,
@andymantell
andymantell / gist:5117319
Created March 8, 2013 15:41
SCSS headings() awesomesauce
#{headings()} {
color: red;
}
@andymantell
andymantell / config.rb
Created September 24, 2012 15:12
Using Compass's callbacks to flush Drupal's cache when a stylesheet is re-compiled
on_stylesheet_saved do |filename|
system("drush cc css-js")
end
@andymantell
andymantell / README.md
Last active October 7, 2015 13:08
Drupal: Using hook_install() and hook_update_N() to manage Mollom configuration
@andymantell
andymantell / README.md
Created July 10, 2012 14:16
Restrict the Drupal Media library to only show images that a user created
@andymantell
andymantell / node_load_multiple_item_list.php
Created May 17, 2011 12:48
Piping results of node_load_multiple through an item list
$nodes = node_load_multiple(array(1,2,3));
$block['content'] = array(
'#theme' => 'item_list',
'#items' => node_view_multiple($nodes),
);