Skip to content

Instantly share code, notes, and snippets.

View paullinney's full-sized avatar

Paul Linney paullinney

View GitHub Profile
@paullinney
paullinney / onet-workactivities.yml
Last active June 19, 2020 12:22
O*net Work Activities
Information Input:
- Estimating the Quantifiable Characteristics of Products, Events, or Information:
Description: Estimating sizes, distances, and quantities; or determining time, costs, resources, or materials needed to perform a work activity.
- Getting Information:
Description: Observing, receiving, and otherwise obtaining information from all relevant sources.
- Identifying Objects, Actions, and Events:
Description: Identifying information by categorizing, estimating, recognizing differences or similarities, and detecting changes in circumstances or events.
- Inspecting Equipment, Structures, or Material:
Description: Inspecting equipment, structures, or materials to identify the cause of errors or other problems or defects.
- Monitor Processes, Materials, or Surroundings:
@paullinney
paullinney / Indexer.php
Created July 24, 2018 18:19
CMT Indexer
<?php
namespace Drupal\cmt_course_index;
use Solarium\Client;
use Drupal\cmt_course\Entity\Course;
use Drupal\cmt_solr_connection\SolrConnection;
/**
* Class Indexer
@paullinney
paullinney / SolrConnection.php
Created July 24, 2018 18:12
CMT Solr Connection
<?php
namespace Drupal\cmt_solr_connection;
use Drupal\Core\Config\ConfigFactory;
/**
* Class SolrConnection
*/
class SolrConnection {
@paullinney
paullinney / solr-api-proxy.php
Created July 12, 2018 12:24
Solr API Proxy - Run a request on a remote solr instance
<?php
/**
* Solr Query Proxy.
* - For use with Solarium Query Objects only.
*/
error_reporting(0);
require __DIR__ . '/../vendor/autoload.php';
<?php
// Callback URLS
if (!$_sds_mywow_strengths_obj->setCallbackUri([
'quiz' => 'start.aspx',
'results' => 'start.aspx', /* Same as quiz but diferent uri param.*/
'xmlResults' => 'SDSRequests/resultsXML.aspx',
'reset' => 'SDSRequests/AJAX_resetProgress.aspx',
'progress' => 'SDSRequests/AJAX_getProgress.aspx'
])
@paullinney
paullinney / MYMODULE.page.inc
Last active April 22, 2017 16:14
Drupal 7 module funcitons for including angular app into page/block
/**
* Page for application.
*/
function MYMODULE_application_page_callback() {
global $user;
drupal_add_html_head([
'#tag' => 'base',
'#attributes' => array(
@paullinney
paullinney / MYMODULE_MYAPP.tpl.php
Last active April 22, 2017 16:16
Angular Application Page/Block Template
<?php
/**
* MYAPP webpack application container
*/
?>
<div id="MYAPP" data-uuid="<?php print $data['uuid']; ?>" data-csrf="<?php print $data['csrf']; ?>">
<?php foreach ($data['css'] as $css): ?>
<link href="/<?php print $css; ?>" rel="stylesheet" />
<?php endforeach; ?>
<div class="application-placeholder">Loading application.</div>
#!/usr/bin/env bash
DRUSH=`which drush`
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SITE_UUID="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
SITE_NAME="Marketplace"
DRUPAL_PROFILE="minimal"
DRUPAL_DB="marketplace"
if [ $HOSTNAME = "$SITE_NAME" ]; then
@paullinney
paullinney / AcquiaCurl.php
Last active August 18, 2016 13:56
Solarium PHP Acquia Client Adapter
<?php
/**
* Copyright 2011 Bas de Nooijer. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
@paullinney
paullinney / auth-update.php
Created July 13, 2016 08:49
Acquia Auth to Selenium Client for Update (post) then returns status
/**
* Adds auth to update request (post)
*
* @param $update
*
* @return $update
*/
function update($update) {
$request = $this->client->createRequest($update);
$endpoint = $this->client->getEndpoint();