Skip to content

Instantly share code, notes, and snippets.

View boboldehampsink's full-sized avatar

Bob Olde Hampsink boboldehampsink

View GitHub Profile

Keybase proof

I hereby claim:

  • I am boboldehampsink on github.
  • I am boboldehampsink (https://keybase.io/boboldehampsink) on keybase.
  • I have a public key ASCRtpA9X58lqau34xxjdiOm8y6GtjPB3Wn5Z4zBP4v29wo

To claim this, I am signing this object:

<?php
namespace Craft;
/**
* The class name is the UTC timestamp in the format of mYYMMDD_HHMMSS_pluginHandle_migrationName.
*/
class m150904_071603_inspections_DistanceText extends BaseMigration
{
/**
<?php
namespace Craft;
class UploadsController extends BaseController {
/**
* Process uploaded files
*
* @author Bob Olde Hampsink
*/
@boboldehampsink
boboldehampsink / MatrixCollapsePlugin.php
Created June 18, 2015 16:57
Matrix Collapse Plugin, put this in a folder called "matrixcollapse" in craft/plugins/
<?php
namespace Craft;
/**
* Matrix Collapse Plugin.
*/
class MatrixCollapsePlugin extends BasePlugin
{
/**
@boboldehampsink
boboldehampsink / ios_disable_push_notifications.js
Created March 17, 2015 15:11
Cordova - after_platform_add hook to disable push notifications code
#!/usr/bin/env node
var GCC_PREPROCESSOR_DEFINITIONS = '"$(inherited) DISABLE_PUSH_NOTIFICATIONS=1"';
var fs = require("fs");
var path = require("path");
var xcode = require('xcode');
var projectRoot = process.argv[2];
function getProjectName(protoPath) {
@boboldehampsink
boboldehampsink / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@boboldehampsink
boboldehampsink / SampleVariable.php
Last active August 29, 2015 14:13
New Entry model with field layout in Craft
<?php
namespace Craft;
class SampleVariable
{
public function newUserModel()
{
// Create a new empty user model
@boboldehampsink
boboldehampsink / YourPlugin.php
Created June 8, 2014 10:43
registerImportOperation example
// Register special hook for Markdown processing
function registerImportOperation(&$data, $handle) {
// Get field info
$field = craft()->fields->getFieldByHandle($handle);
// If it's a field ofcourse
if(!is_null($field)) {
// For some fieldtypes the're special rules
<?php
return array(
"Analytics" => "Analytics",
"Plugin installed" => "Plugin geïnstalleerd",
"Couldn't install plugin." => "Kon plugin niet installeren",
"Analytics Settings" => "Analytics instellingen",
"Configure Analytics plugin in order to get started" => "Stel de Analytics plugin in om te beginnen",
"More Data" => "Meer gegevens",
"Less" => "Minder",
@boboldehampsink
boboldehampsink / SlugifyPlugin.php
Last active May 16, 2016 12:56
Slugify Twig Extension - Use like this: {{ user.fullName | slugify }}. Uses Craft's core slug technology.
<?php
namespace Craft;
class SlugifyPlugin extends BasePlugin
{
public function getName()
{
return Craft::t('Slugify Twig Extension');
}