View confirm_form_example.module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* confirm form example module | |
* | |
* */ | |
function confirm_form_example_menu() { | |
$items['confirm_form_example_delete_object'] = array( |
View gist:3919058
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function MYFORM_submit( $form, &$form_state ) { | |
$msg = ''; | |
$msg_type = 'status'; | |
$redirect = 'admin/MYMODULE/INDEX_PATH'; | |
$action = 'save your changes'; | |
$expected = SAVED_UPDATED; | |
$update_msg = 'Your changes to the %category category have been saved.'; | |
if ( is_numeric( $form_state['values']['id'] ) ) { | |
$TABLE_DATA['id'] = $form_state['values']['id']; | |
$result = drupal_write_record( 'MYTABLE', $TABLE_DATA, 'id' ); |
View send-email.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Quick utility script to send email out ... before you send this out, | |
* run this to load up the Sendgrid API key into your environment: | |
* source ./sendgrid.env | |
* | |
* Also, this code uses composer and the sendgrid/sendgrid library: | |
* composer require sendgrid/sendgrid | |
*/ |
View aws-sns-lambda-example.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Records": [ | |
{ | |
"EventSource": "aws:sns", | |
"EventVersion": "1.0", | |
"EventSubscriptionArn": "arn:aws:sns:us-east-1:123412341234:LambdaTesting:12b6a0a7-bbbb-ffff-cccc-7a7d21e25123", | |
"Sns": { | |
"Type": "Notification", | |
"MessageId": "614a0b34-bbbb-ffff-cccc-58ffddd9745f", | |
"TopicArn": "arn:aws:sns:us-east-1:123412341234:LambdaTesting", |
View index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var aws = require('aws-sdk'); | |
var ddb = new aws.DynamoDB({ | |
params: { | |
TableName: process.env.ddb_table_name | |
} | |
}); | |
exports.handler = function(event, context, callback) { | |
var result = true; | |
for (var i=0, len = event.Records.length; i < len; i++) { | |
saveToDynamoDB(event.Records[i], context); |
View build-master-lite.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This is a daily script to build an updated master-lite database for our various pubs. | |
for site in site1 site2 site3 | |
do | |
echo "Building master-lite for $site" | |
# First, make sure the master-lite env is woke. | |
echo "Making sure master-lite environment is woke - $site." |
View config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is Journalistic's A&O CI workflow. Whenever we push code to github | |
# that's not the master branch, it needs to download the branch, push it up to | |
# Pantheon, create a CI environment, run the visual regression testing, and | |
# then run the cypress testing. | |
defaults: &defaults | |
docker: | |
- image: quay.io/pantheon-public/build-tools-ci:4.x | |
working_directory: ~/app | |
environment: |
View gist:d4e6d351023162c6cf40c4a13d3d27f2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml"> | |
<head> | |
<!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--> | |
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> | |
<meta content="width=device-width" name="viewport"/> | |
<!--[if !mso]><!--> | |
<meta content="IE=edge" http-equiv="X-UA-Compatible"/> | |
<!--<![endif]--> |
View pre-commit.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
// Credit: https://carlosbuenosvinos.com/write-your-git-hooks-in-php-and-keep-them-under-git-control/ | |
require __DIR__ . '/../../vendor/autoload.php'; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
use Symfony\Component\Process\Process; |