Skip to content

Instantly share code, notes, and snippets.

View netsensei's full-sized avatar
👾
retro-wave driven development

Matthias Vandermaesen netsensei

👾
retro-wave driven development
View GitHub Profile
@netsensei
netsensei / Gruntfile.js
Created December 15, 2013 14:34
Grunt + Jekyll + Compass. Acts as a double pipeline: one line acts on HTML file changes, rebuilding the entire project, the second pipeline just acts on SCSS changes: watch, compile & copy to the jekyll compiled css folder. Includes livereload support via nodejs! Based on https://github.com/thanpolas/thanpolas.github.com/blob/master/Gruntfile.js
module.exports = function (grunt) {
"use strict";
// Config...
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
copy: {
css : {
src: 'css/**',
@netsensei
netsensei / uninstall_table.patch
Created July 6, 2013 15:23
Uninstalls wp_mollom and upgrades the schema definition.
From 707f11370d155a20d83ce90dd89568b1b2e195b1 Mon Sep 17 00:00:00 2001
From: Matthias Vandermaesen <[email protected]>
Date: Sat, 6 Jul 2013 16:47:14 +0200
Subject: [PATCH] Added: uninstall tables defined in MollomSchema::getSchema()
---
includes/Schema.php | 25 ++++++++++++++++++++++---
uninstall.php | 4 +++-
2 files changed, 25 insertions(+), 4 deletions(-)
@netsensei
netsensei / drupal-ajax.php
Created November 7, 2012 11:14
Minimal Drupal Bootstrap for AJAX requests
<?php
/**
* @file
*
* Minimal AJAX page. Call like this:
* $.ajax({
* type: 'GET',
* url: '/drupal-ajax.php?param1=...
* data: {},
@netsensei
netsensei / seasoning.php
Created September 20, 2012 11:52
Deduces the season based on a given date
<?php
function get_season($hemisphere = 'northern', $date = '') {
$now = (!empty($date)) ? strtotime($date) : strtotime(date('Y/m/d'));
$season_dates = array(
'northern' => array(
'/03/21' => 'spring',
'/06/21' => 'summer',
'/09/21' => 'autumn',
'/12/21' => 'winter',
@netsensei
netsensei / solr_objects.php
Created January 19, 2012 11:04
Get a Solr Query and Response object in D7
$env_id = 'solr';
$query = apachesolr_current_query($env_id);
if ($query) {
$response = apachesolr_static_response_cache($query->getSearcher());
}
$query_params = $query->getParams();
@netsensei
netsensei / size_mysql_cli.sql
Created December 13, 2011 09:51
MySQL Get table sizes if you don't have PHPMyAdmin
SELECT table_schema "<tablename>", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB", sum( data_free )/ 1024 / 1024 "Free Space in MB" FROM information_schema.TABLES GROUP BY table_schema ;
SELECT table_name, sum( data_length + index_length ) / 1024 / 1024 FROM tables WHERE table_schema = "<tablename>";