Skip to content

Instantly share code, notes, and snippets.

View OctaneInteractive's full-sized avatar
🏠
Working from home

Wayne Smallman OctaneInteractive

🏠
Working from home
  • Yorkshire, England.
View GitHub Profile
@OctaneInteractive
OctaneInteractive / router.js
Created April 6, 2023 12:41
Router in Vue 2
import Vue from 'vue'
import Router from 'vue-router'
import Store from '../store'
Vue.use(Router)
let router = new Router({
mode: 'history',
routes: [
/**
@OctaneInteractive
OctaneInteractive / files.js
Created April 6, 2023 09:45
Routes in Express to process and upload files via Multer to Google Drive
module.exports = (Router, Joi, fileOperations) => {
const { services } = require('../common/configurations')
// Diagnostics.
const factoryForDiagnostics = require('../mixins/diagnostics')
const diagnostics = factoryForDiagnostics({ log4js: fileOperations.log4js, nameOfChannel: 'default', level: 'debug' })
// Mixins.
@OctaneInteractive
OctaneInteractive / google.js
Created April 6, 2023 09:31
Methods to interact with various Google API endpoints
const {
google
} = require('googleapis')
const stream = require('stream')
const configurationsForApplication = require('../../common/configurations')
const RedisFactory = require('../../modules/redis')
const clientForRedis = RedisFactory(configurationsForApplication.databases.Redis)
@OctaneInteractive
OctaneInteractive / d3.html
Last active January 31, 2023 08:55
An example of a Force-Directed Graph, via D3.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>D3</title>
<style>
html {
background-color: rgba(62, 62, 62, 0.95);
@OctaneInteractive
OctaneInteractive / index.html
Last active February 3, 2021 14:12
Text on a path in Fabric
<!doctype html>
<html>
<head>
<title>Text on a path, using Fabric!</title>
<link href="styles.css" rel="stylesheet">
<script src="https://unpkg.com/fabric@4.3.0/dist/fabric.js"></script>
<script src="text-on-a-path.js"></script>
</head>
<body>
<canvas ref="canvas" id="canvas" class="canvas"></canvas>
# Add to ".bashrc" or ".bash_profile".
find_command () {
# find command.
# Usage: find_command term
if [ "$1" ]; then
history | grep -i $1
else
@OctaneInteractive
OctaneInteractive / Grab date & time data from web pages
Last active December 29, 2015 16:59
Grab date & time data from a web page and turn it into timestamp.
$(document).ready(function(){
var objDateTimeTags = new Object({
// The Dublin Core Metadata Initiative (DCMI) ( http://dublincore.org/about-us/ ).
option1: function () {
var datetime_published = $("meta[name='DC.Date']").attr("content");
return validation(datetime_published);
},
option2: function () {
var datetime_published = $("dc\\:date").text();
return validation(datetime_published);