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
brew install php55 --with-pgsql --verbose --debug
/usr/local/Library/brew.rb (Formulary::StandardLoader): loading /usr/local/Library/Taps/homebrew/homebrew-php/Formula/php55.rb
/usr/local/Library/brew.rb (Formulary::StandardLoader): loading /usr/local/Library/Formula/freetype.rb
/usr/local/Library/brew.rb (Formulary::StandardLoader): loading /usr/local/Library/Formula/libpng.rb
/usr/local/Library/brew.rb (Formulary::StandardLoader): loading /usr/local/Library/Formula/gettext.rb
/usr/local/Library/brew.rb (Formulary::StandardLoader): loading /usr/local/Library/Formula/jpeg.rb
/usr/local/Library/brew.rb (Formulary::StandardLoader): loading /usr/local/Library/Formula/unixodbc.rb
/usr/local/Library/brew.rb (Formulary::TapLoader): loading /usr/local/Library/Taps/homebrew/homebrew-dupes/zlib.rb
/usr/local/Library/brew.rb (Formulary::StandardLoader): loading /usr/local/Library/Formula/libtool.rb
/usr/local/Library/Taps/homebrew/homebrew-php/Formula/php55.rb (Formulary::StandardLoader): loading /usr/local/Library/For
which pg_config
/usr/local/bin/pg_config
/usr/local/bin/pg_config --includedir
/usr/local/Cellar/postgresql-9.3/9.3.4/include
brew install php55 --with-pgsql --verbose
==> Downloading http://www.php.net/get/php-5.5.14.tar.bz2/from/this/mirror
Already downloaded: /Library/Caches/Homebrew/php55-5.5.14
==> Verifying php55-5.5.14 checksum
function uib_user_field_attach_view_alter(&$output, $context) {
$foobar = array(
'#theme' => 'field',
'#field_name' => 'field_uib_last_name',
'#field_type' => 'text',
'#title' => 'My very last name',
'#label_display' => 'inline',
'#bundle' => 'user',
array(
'#markup' => 'Foobar'
drush pml --status=enabled
Package Name Type Version
Administration Admin Role (adminrole) Module 6.x-1.3
Administration Administration menu (admin_menu) Module 6.x-1.8
Administration Module filter (module_filter) Module 6.x-1.7
Annet Autoload (autoload) Module 6.x-2.1
Annet Automatic Nodetitles (auto_nodetitle) Module 6.x-1.2
Annet Better Formats (better_formats) Module 6.x-1.2
Annet Colorbox (colorbox) Module 6.x-1.4
Annet Diff (diff) Module 6.x-2.3
@steinmb
steinmb / gist:9240951
Created February 26, 2014 23:22
hook_update_N() example moving blocks
<?php
/**
* Move system user-menu block from header to region-top.
*/
function elmcip_setup_update_7004() {
$num_updated = db_update('block')
->fields(array(
'region' => 'header_top',
'status' => 1,
'weight' => 1,
@steinmb
steinmb / gist:8667790
Created January 28, 2014 13:38
page.tpl.php changes
diff --git a/themes/elmcip/templates/page.tpl.php b/themes/elmcip/templates/page.tpl.php
index e759d0b..f3d00c8 100644
--- a/themes/elmcip/templates/page.tpl.php
+++ b/themes/elmcip/templates/page.tpl.php
@@ -73,10 +73,6 @@
<?php print render($page['header_top']); ?>
<div id="header"><div class="section clearfix">
- <?php if ($logo): ?>
- <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo"><img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" /></a>
# 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>
@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(
@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"
}
#!/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