Skip to content

Instantly share code, notes, and snippets.

View burnsjeremy's full-sized avatar

Jeremy Burns burnsjeremy

View GitHub Profile
@chrisfree
chrisfree / drupal-8-drush-deployment.sh
Created January 8, 2016 14:35
Example Drupal 8 Deployment with Drush
#!/bin/bash
echo ""
echo "Switching to project docroot."
cd /var/www/chromatichq.com/docroot
echo ""
echo "Pulling down the latest code."
git pull origin master
echo ""
echo "Clearing drush caches."
<?php
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
/**
* Defines application features from the specific context.
*/
class FeatureContext implements Context, SnippetAcceptingContext {
Feature: As a user of the drupal-extension and drupal driver
I want to properly set term references on content
So that I may reliably conduct tests
@api
Scenario: Duplicate terms in different vocabs
Given "category" terms:
| name |
| A |
| B |
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@ceokot
ceokot / NestedAjaxDataSource.js
Created August 25, 2013 00:11
An implementation of the awesome Fuel UX datagrid with an ajax-enabled data source that also supports nested properties.
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define([ 'underscore' ], factory);
} else {
root.NestedAjaxDataSource = factory();
}
}(this, function() {
var NestedAjaxDataSource = function(options) {
this._formatter = options.formatter;
@JoeHetfield
JoeHetfield / NestedDataSource.js
Last active December 21, 2015 02:59
This is data source for fuelux's datagrid, which support nested property. property could nested in many level, until property path hit null or undefined, then the result will be "null" or "undefined". could be useful, I think.
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['underscore'], factory);
} else {
root.NestedDataSource = factory();
}
}(this, function () {
var NestedDataSource = function (options) {
this._formatter = options.formatter;

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
#!/usr/bin/env python
"""
Convert camel-case to snake-case in python.
e.g.: CamelCase -> snake_case
Relevant StackOverflow question: http://stackoverflow.com/a/1176023/293064
"""
@alsoicode
alsoicode / gist:5381417
Last active December 16, 2015 04:59
On-Demand Ajax DataSource for FuelUX DataGrid
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['underscore'], factory);
} else {
root.AjaxOnDemandDataSource = factory();
}
}(this, function () {
var AjaxOnDemandDataSource = function(options) {
this._formatter = options.formatter;
@dantudor
dantudor / gist:4594469
Last active April 28, 2017 21:28
Behat Tests in PHPUnit with Symfony 2.1
<?php
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Behat\Behat\Console\BehatApplication;
class BehatTest extends WebTestCase
{
/**