Skip to content

Instantly share code, notes, and snippets.

View andrewhthomas's full-sized avatar

Andrew Thomas andrewhthomas

View GitHub Profile
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="theme1-tab" data-toggle="tab" href=".tab-pane1" role="tab" aria-controls="theme1" aria-selected="true">Theme 1</a>
</li>
<li class="nav-item">
<a class="nav-link" id="theme2-tab" data-toggle="tab" href=".tab-pane2" role="tab" aria-controls="theme2" aria-selected="false">Theme 2</a>
</li>
<li class="nav-item">
<a class="nav-link" id="theme3-tab" data-toggle="tab" href=".tab-pane3" role="tab" aria-controls="theme3" aria-selected="false">Theme 3</a>
</li>
let mix = require('laravel-mix');
require('laravel-mix-imagemin');
let PATHS = {
node: './node_modules',
src: './src',
dist: './dist',
proxy: 'http://pafa.lndo.site'
};
@andrewhthomas
andrewhthomas / sswba.theme
Last active March 22, 2019 23:33
Change logo from svg to png
<?php
/**
* Implements hook_preprocess_HOOK() for block templates.
*/
function sswba_preprocess_block(&$variables) {
switch ($variables['base_plugin_id']) {
case 'system_branding_block':
$variables['site_logo'] = '';
if ($variables['content']['site_logo']['#access'] && $variables['content']['site_logo']['#uri']) {
$variables['site_logo'] = str_replace('.svg', '.png', $variables['content']['site_logo']['#uri']);
@andrewhthomas
andrewhthomas / local.settings.php
Created June 22, 2018 21:16
Lando - Local settings file for Drupal 7
<?php
$databases['default']['default'] = array(
'database' => "drupal7",
'username' => "drupal7",
'password' => "drupal7",
'host' => "database",
'driver' => "mysql",
'port' => 3306,
'prefix' => "",
@andrewhthomas
andrewhthomas / settings.local.php
Last active June 22, 2018 21:12
Lando - Local settings file for Drupal 8
<?php
// @codingStandardsIgnoreFile
/**
* @file
* Local development override configuration feature.
*
* To activate this feature, copy and rename it such that its path plus
* filename is 'sites/default/settings.local.php'. Then, go to the bottom of
@andrewhthomas
andrewhthomas / unm-google-books-fetch.php
Last active May 24, 2018 18:51
UNM Google Books fetch
<?php
$node = node_load($data->nid);
$node_wrapper = entity_metadata_wrapper('node', $node);
$product = $node_wrapper->field_product[0];
$product_isbn = str_replace('-','', $product->field_isbn->value());
$url = "https://www.googleapis.com/books/v1/volumes?q=isbn:" . $product_isbn . "&country=US";
$curl_handle=curl_init();
curl_setopt($curl_handle, CURLOPT_URL, $url);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
@andrewhthomas
andrewhthomas / create_labels.sh
Created January 3, 2017 21:56 — forked from omegahm/create_labels.sh
Create Gtihub labels from Bash
#!/usr/bin/env bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
###
# Label definitions
###
declare -A LABELS
# Platform
@andrewhthomas
andrewhthomas / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@andrewhthomas
andrewhthomas / gist:e9acd412cfa392a4a595
Last active August 29, 2015 14:11
SugarCRM note export
SELECT CONCAT(`notes`.`date_entered`, '~', `users`.`user_name`, '~', `notes`.`description`) as note FROM `notes`
Join `accounts` on
`notes`.`parent_id` = `accounts`.`id`
join
`users` on
`notes`.`created_by` = `users`.`id`
where `notes`.`parent_id` = 2 and `notes`.`parent_type` = 'Accounts' and `notes`.`deleted` = 0 order by `notes`.`date_entered` DESC
@andrewhthomas
andrewhthomas / node_form_insert.php
Last active December 14, 2015 05:08
Drupal 6 database insert for Scribe SAI users
<?php
$fname = mysql_real_escape_string($_GET["fname"]);
$lname = mysql_real_escape_string($_GET["lname"]);
$company = mysql_real_escape_string($_GET["company"]);
$email = mysql_real_escape_string($_GET["email"]);
$datetime = strtotime(now);
$mysqldate = date('Y-m-d H:i:s', $datetime);
if (!empty($fname) && !empty($lname) && !empty($email)) {