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 | |
use Drupal\Core\Database\Database; | |
/** | |
* Implements hook_install(). | |
*/ | |
function mymodule_install() { | |
$connection = Database::getConnection('default'); |
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 | |
namespace Drupal\harlib_search\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
use GuzzleHttp\Client; | |
use Psr\Log\LoggerInterface; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Symfony\Component\HttpFoundation\RequestStack; | |
use GuzzleHttp\Exception\RequestException; |
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 | |
namespace Drupal\Tests\iana_netforum_auth\Unit; | |
use Drupal\Tests\UnitTestCase; | |
use Drupal\iana_netforum_auth\Utility\EmailMatcher; | |
/** | |
* Test email matching component class. | |
* |
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 | |
namespace Drupal\iana_netforum_auth\Utility; | |
/** | |
* Class EmailMatcher. | |
* | |
* @package Drupal\iana_netforum_auth\Utility | |
*/ | |
class EmailMatcher { |
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 bash | |
branch=`echo ${TRAVIS_BRANCH}`; | |
if [ $branch = "master" ]; then | |
echo "Building assets for production."; | |
gulp build --env production; | |
else | |
echo "Building assets for development."; | |
gulp build --no-watch; |
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 | |
/** | |
* Creates a temporary table to hold values from an uploaded CSV. | |
* @param $table_name | |
* @param $columns | |
* @param $message | |
* @param $context | |
*/ | |
function csv_import_create_temp_table($table_name, $columns) { |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
syntax enable | |
set number | |
set showcmd | |
set hlsearch | |
set incsearch | |
set nobackup | |
set noswapfile |
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
CREATE PROCEDURE changeFieldFormatValueTo (IN format_name VARCHAR(32)) | |
BEGIN | |
DECLARE done INT DEFAULT FALSE; | |
DECLARE table_name_value VARCHAR(64); | |
DECLARE column_name_value VARCHAR(64); | |
DECLARE cursor_fields CURSOR FOR SELECT TABLE_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME LIKE 'field_%_format'; | |
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; | |
OPEN cursor_fields; |
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
# Force all traffic to HTTPS, except a local instance | |
RewriteCond %{HTTPS} off | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
RewriteCond %{HTTP_HOST} !^mysite\.local$ [NC] | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
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 new_post() { | |
cd ~/Sites/kevinquillen.com/_posts | |
today=$(date +"%F") | |
title=$1:l | |
clean_title=${title//[^a-zA-Z0-9]/-} | |
filename="$today-$clean_title.markdown" | |
if [[ ! -a ./$filename ]]; then | |
vim $filename -c 'w' | |
else |