Skip to content

Instantly share code, notes, and snippets.

View shrop's full-sized avatar
👋

Mark Shropshire shrop

👋
View GitHub Profile
@shrop
shrop / policy.drush.inc
Created April 8, 2016 15:51
Sample Drush policy file
<?php
/**
* @file
* Drush policies to restrict what is allowed for certain drush commands.
*/
/**
* Prevent production databases from being overwritten using drush sql-sync.
*/
@shrop
shrop / make-drupal-file-field-private.sh
Last active April 11, 2016 18:49 — forked from thsutton/make-drupal-file-field-private.sh
Hold your hand through the process of converting an existing Drupal 7 file field to use the private file system.Update the $FIELD variable (and, if required, the path and arguments for drush) and do what it tells you to.
#!/bin/sh
#
# This script will hold your hand during the process of converting an existing Drupal 7 file field from public to private.
#
# http://twitter.com/thsutton
# http://www.linkedin.com/pub/thomas-sutton/55/391/350
# http://thomas-sutton.id.au/
set -eu
@shrop
shrop / chimp-meteor.js
Created December 19, 2015 18:18
Starts Meteor or Meteor + Mirror then starts Chimp
#!/usr/bin/env node
var path = require('path'),
fs = require('fs'),
extend = require('util')._extend,
exec = require('child_process').exec;
var appOptions = {
settings: 'settings.json',
port: 3000,
env: {
#!/bin/bash
# Startup Chimp testing instance
MONGO_PORT=3001
METEOR_PORT=3100
MONGO_URL=mongodb://localhost:$MONGO_PORT/chimp_db meteor --port $METEOR_PORT --settings=settings.json $@
@shrop
shrop / nginx.conf
Created July 28, 2015 17:57
nginx config for Meteor
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
$ find . -name '2016_apc_rvu.php' -print0 | xargs -0 perl -pi -e 's/<a href=\"surveys.php\" class=\"LeftNavLink\">SATRO\&reg\; Surveys</a><br>/<a href=\"surveys.php\" class=\"LeftNavLink\">SATRO\&reg\; Surveys</a><br>\n<a href=\"2016_apc_rvu.php\" class=\"LeftNavLink\">2016 APCs and RVUs</a><br>/g'
$ Can't find string terminator '"' anywhere before EOF at -e line 1.
@shrop
shrop / logActivity.js
Created June 23, 2015 00:32
logActivity Jasmine test
describe('logActivity server method', function() {
it('saves an activity document to the posts collection', function() {
// Get the testuser document.
testUser = Meteor.users.findOne( { 'profile.userName': 'testuser' } );
// Mock Meteor.userId().
spyOn(Meteor, 'userId').and.returnValue(testUser._id);
// Mock inserts for activity.
spyOn(Activity, 'insert');
type = 'post';
@shrop
shrop / .versions
Created June 8, 2015 15:44
.versions file generated by meteor publish for drupal-ddp
accounts-base@1.2.0
accounts-password@1.1.1
base64@1.0.3
binary-heap@1.0.3
callback-hook@1.0.3
check@1.0.5
ddp@1.1.0
ejson@1.0.6
email@1.0.6
geojson-utils@1.0.3
@shrop
shrop / cucumber-steps-features.js
Last active August 29, 2015 14:22
Meteor cucumber steps for using a logged in user via @patrickml
(function () {
'use strict';
module.exports = function () {
var url = require('url');
this.Given(/^I am a new user$/, function () {
//Reset the Database and reseed it
@shrop
shrop / gist:c61bd91a48a2fddcbc71
Created May 23, 2015 15:10
Successful Jenkins run of meteor --test with Jasmine and Cucumber tests
GitHub pull request #1 of commit c777da4ad9b015e776336635b18a55485a29c900, no merge conflicts.
Setting status of c777da4ad9b015e776336635b18a55485a29c900 to PENDING with url http://jenkins.blackboot.biz:8080/job/ci-test/18/ and message: Build started, sha1 is merged
Building in workspace /var/lib/jenkins/jobs/ci-test/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/hb5co/ci-test.git # timeout=10
Fetching upstream changes from https://github.com/hb5co/ci-test.git
> git --version # timeout=10
using .gitcredentials to set credentials
> git config --local credential.helper store --file=/tmp/git4317210699226004625.credentials # timeout=10