Skip to content

Instantly share code, notes, and snippets.

View rocketeerbkw's full-sized avatar

Brandon Williams rocketeerbkw

View GitHub Profile
@rocketeerbkw
rocketeerbkw / README.md
Created November 16, 2023 14:31
Lagoon Storage Charts

PoC Lagoon Environment Storage Charts

Generates a set of line charts to plot detailed storage information for all environments in a project. Can help when comparing the compiled data in a billing tool to the raw data from Lagoon.

Instructions

  1. Get a copy of the storage data from the Lagoon API and save it as a file.
@rocketeerbkw
rocketeerbkw / keybase.md
Created June 28, 2019 11:14
keybase.md

Keybase proof

I hereby claim:

  • I am rocketeerbkw on github.
  • I am rocketeerbkw (https://keybase.io/rocketeerbkw) on keybase.
  • I have a public key ASC4YJrRu7CqRXPxZG298s6l0FoE1mqcJccGttsJ7Mo0Ugo

To claim this, I am signing this object:

@rocketeerbkw
rocketeerbkw / field_data.txt
Created August 22, 2016 09:04
How to migrate multi-value formatted text field in Drupal 8
value 0 of field_formatted_text
value 1 of field_formatted_text
value 2 of field_formatted_text
@rocketeerbkw
rocketeerbkw / example.php
Last active June 23, 2023 18:42
How to migrate multi-value link field in Drupal 8
<?php
class Example extends SourcePluginBase {
public function prepareRow(Row $row) {
parent::prepareRow($row);
// I do some data manipulation to end up with an array that looks like this,
// which I want to import into multi-value link field.
$links = [
@rocketeerbkw
rocketeerbkw / composer.json
Created June 23, 2016 14:12
Example composer.json for to use composer to install modules for Drupal 8
{
"name": "drupal/drupal",
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
"type": "project",
"license": "GPL-2.0+",
"require": {
"composer/installers": "^1.0.21",
"wikimedia/composer-merge-plugin": "~1.3",
"drupal/geofield": "1.0.0-alpha2",
"drupal/address": "1.0.0-beta3"
<?php
$encoded = [
['55', '66', '78', '80', '00', 'FF', 'FF', '00'],
];
$decoded = '';
foreach ($encoded as $hex_word) {
$bin_word = [];
<?php
$encoded = ['x/y', 'x/y'];
$chars = [];
// Calculate the full prime number
$prime_num = gmp_sub(gmp_pow($exp, $base), 1);
$prime = gmp_strval($prime_num);
// Convert encoded message to 5-bit characters
@rocketeerbkw
rocketeerbkw / gist:444ad78263268eab2366
Last active August 29, 2015 14:21
BTTF Time Circuits

Back To The Future

Scenes with time circuits

  • 00:19:52
  • 00:20:16
  • 00:24:09
  • 00:24:39
  • 00:29:54
  • 00:30:00
  • 00:30:03
  • 00:30:15
<!DOCTYPE html>
<html>
<head>
<style>
.pixel {
width: 2px;
height: 2px;
float: left;
}
</style>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script>
alphabet = [];
alphabet[47] = 'a';
alphabet[55] = 'b';
alphabet[63] = 'c';