Skip to content

Instantly share code, notes, and snippets.

View steinmb's full-sized avatar
💭
Pining for the fjords

Stein Magne Bjørklund steinmb

💭
Pining for the fjords
View GitHub Profile
@steinmb
steinmb / gist:4131871
Last active October 13, 2015 03:27
Sublime Drupal config
{
"color_scheme": "Packages/Phix Color Scheme/Phix Dark.tmTheme",
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": true,
"fallback_encoding": "UTF-8",
"font_size": 12.0,
"rulers":
[
80
],
@steinmb
steinmb / gist:4509423
Last active December 10, 2015 23:28
W2 debugging
$view = new view();
$view->name = 'de';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'de';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
@steinmb
steinmb / gist:5005277
Last active December 14, 2015 01:19
Drupal file debugging tool
$view = new view();
$view->name = 'more_files';
$view->description = 'Admin tool. Lists all files';
$view->tag = 'default';
$view->base_table = 'file_managed';
$view->human_name = 'More files';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
@steinmb
steinmb / gist:5151384
Created March 13, 2013 11:49
Sublimetext 2 PHP build system. Goto Tools->Build system->New build system. Replace content with this. You are now able to build PHP directly within ST2 by running Tool->Build or crtl+B/command+B(OS X).
{
"cmd": ["php", "-d", "error_prepend_string=''", "-d", "error_append_string=''", "-d", "xdebug.default_enable='Off'", "-f", "$file"],
"file_regex": ".*(?: in )(.*) on line ([0-9]*)",
"selector": "source.php"
}
@steinmb
steinmb / gist:5632073
Created May 23, 2013 00:55
Complete Twig megapatch list
Issue #1896060 by shanethehat, Cottser, joelpittet, disasm, Floydm, stevector, jenlampton, c4rl, mr.baileys: [READY] aggregator.module - Convert PHPTemplate templates to Twig.
Issue #1898034 by Cottser, jenlampton, joelpittet, Shawn DeArmond, idflood, Hydra, chrisjlee, gnuget, c4rl, thund3rbox, steinmb, TrevorBradley, geoffreyr: Block.module - Convert PHPTemplate templates to Twig.
Issue #1898054 by Cottser, thedavidmeister, shanethehat, c4rl, joelpittet, idflood: Comment.module - Convert PHPTemplate templates to Twig.
Issue #1898418 by Cottser, shanethehat, c4rl, joelpittet, disasm, Floydm, jenlampton: Forum.module - Convert PHPTemplate templates to Twig.
Issue #1898424 by joelpittet, ezeedub, mr.baileys, duellj, Cottser | c4rl: [READY] layout.module - Convert PHPTemplate templates to Twig.
Issue #1898432 by Cottser, shanethehat, jenlampton, c4rl, steveoliver, chrisjlee, Hydra: Node.module - Convert PHPTemplate templates to Twig.
Issue #1898454 by c4rl, jerdavis, gnuget, Hydra, mr.baileys, Sean Charles, joel
@steinmb
steinmb / gist:5770448
Created June 13, 2013 01:02
Homebrew
##XCode
Install howebrew
Install X11 (http://xquartz.macosforge.org)
##PHP (Same goes for 5.3.x)
#Install homebrew-php
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
#!/bin/bash
cd /Users/steinmb/apache/htdocs/uib/w3.uib.no
# Get production
sudo chmod -R 777 site/files/
bin/site-prod-reset
sudo chmod -R 777 site/files/
bin/site-drush cc all
bin/site-drush fl
@steinmb
steinmb / gist:6205332
Created August 11, 2013 15:20
Sublimetext 2 PHP build system config
{
"cmd": ["php", "-d", "error_prepend_string=''", "-d", "error_append_string=''", "-d", "xdebug.default_enable='Off'", "-f", "$file"],
"file_regex": ".*(?: in )(.*) on line ([0-9]*)",
"selector": "source.php"
}
@steinmb
steinmb / gist:6354634
Last active December 21, 2015 19:29
Stolen from @seanr with his blessing. Releasing the power of EntityFieldQuery(). The basic idea with this code is it's a ctools content type that allows you to dynamically build a sort of "mini-view" with a very limited set of options, so the user can arbitrarily pull content according to a limited set of criteria and then display it in the chos…
<?php
/**
* @file
*
* Note that there is no need for a hook_block() to define it. CTools automatically scans all
* of the subdirectories here for *.inc files, and reads the contents of the $plugin array
* defined below to figure out how to use the widget.
*/
$plugin = array(
# Turn off all options we don't need.
Options None
Options +FollowSymLinks
# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
# Override the handler again if we're run later in the evaluation list.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>