Skip to content

Instantly share code, notes, and snippets.

View cam8001's full-sized avatar
💭
lol no

Cameron Tod cam8001

💭
lol no
  • Amazon Web Services
  • Wellington, New Zealand
  • 10:58 (UTC +12:00)
View GitHub Profile
@Berdir
Berdir / contententity.php
Created March 3, 2014 22:10
Drupal Content Entity Parser for Kint, place in parsers/custom
<?php
use Drupal\Core\Entity\ContentEntityInterface;
class Kint_Parsers_ContentEntity extends kintParser
{
private static $cache = array();
protected function _parse(&$variable)
{
@jrbeeman
jrbeeman / wc_share.module
Created June 24, 2014 20:14
Example of simple custom sharing widget module in Drupal
<?php
/**
* @file
* Watercooler: Share module.
*
* Twitter widget generated at: https://about.twitter.com/resources/buttons#tweet
* Facebook widget generated at: https://developers.facebook.com/docs/plugins/like-button/
* Google+ widget generated at: https://developers.google.com/+/web/+1button/
*
@zpao
zpao / README.md
Created June 6, 2011 17:56
autoconf 2.13 homebrew formula

Install

  1. install homebrew
  2. place autoconf.rb into Formula folder: /usr/local/Library/Formula/
  3. run brew install autoconf
@benbuckman
benbuckman / drupal-syslog-parser.js
Created November 29, 2011 17:56
node.js script to parse Drupal logs in linux syslog (and find distinct 404'd URLs)
// drupal log parser w/ node.js
// takes a filtered syslog file
// run as node `drupal-syslog-parser.js LOGPATH`
// [install dependencies (lazy,underscore) first with `npm install ___`]
var lazy = require('lazy')
, fs = require('fs')
, path = require('path')
, _ = require('underscore');
@saltednut
saltednut / dice.sh
Last active March 26, 2016 04:09
quick build script for Drupal distributions that ship with a build makefile
#!/usr/bin/env bash
# Usage: dice makefile docroot dbuser dbpass dbname sitename install-profile
drupal_install_clean_env() {
if [[ -r $2 ]]; then
sudo rm -r $2
cd ~/
fi
if [[ -r $1 ]]; then
drush make --working-copy --concurrency=5 $1 $2
@typhonius
typhonius / acquia.inc
Last active May 9, 2017 18:18
An include file for the Acquia Cloud to be placed at the docroot/sites/acquia.inc location. May be optionally called from the site's settings.php with further details found on the Acquia Knowledgebase article.
<?php
/**
* @file
* Utilities for use in protecting an environment via basic auth or IP whitelist.
*/
function ac_protect_this_site() {
global $conf;
@benhedrington
benhedrington / dropbox
Created April 10, 2012 01:06
Dropbox init.d
#!/bin/sh
# dropbox service
# Replace with linux users you want to run Dropbox clients for
DROPBOX_USERS="user1 user2"
DAEMON=.dropbox-dist/dropbox
start() {
echo "Starting dropbox..."
for dbuser in $DROPBOX_USERS; do
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>%@ %@</key>
<string>%@ %@</string>
<key>%@ %@ at %@</key>
<string>%@-%@_%@</string>
<key>%@ %@(%@)</key>
<string>%@ %@(%@)</string>
@jhedstrom
jhedstrom / FeatureContext.php
Last active April 5, 2019 10:25
Step-definition for complex node structure (field collection + entity reference).
<?php
/**
* @Given /^I am viewing a product with the following related products:$/
*/
public function assertRelatedProducts(TableNode $relatedProducts) {
// First, create a product.
$product = (object) array(
'title' => 'Parent Product',
'type' => 'product',
'uid' => 1,
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.