Skip to content

Instantly share code, notes, and snippets.

@BrandonMorr
BrandonMorr / random-godot-shite.gd
Created July 19, 2020 09:48
Random godot shite
# return random 2D vector inside bounds 0 & 0, bound_x & bound_y
func random_vector2(bound_x, bound_y):
return Vector2(randf() * bound_x, randf() * bound_y)
set nocompatible
set paste
set expandtab
set tabstop=2
set shiftwidth=2
set autoindent
set smartindent
set number
set ruler
set mouse=a
@BrandonMorr
BrandonMorr / handle-the-handles.php
Last active November 16, 2018 19:51
Handle dem' handles...
<?php
/**
* @file
* Simple script to force deriv regeneration, thus resulting in updating handle if not present.
*
* Eg. drush -v -u 1 -r /var/www/drupal7 scr handle-the-handles.php /full/path/to/pid-list.txt
*/
module_load_include('inc', 'islandora', 'includes/derivatives');
$pid_list = drush_shift();
@BrandonMorr
BrandonMorr / validate-handles.sh
Last active November 15, 2018 18:55
A really really neat handle validation script.
#!/bin/bash
# This script validates a list of handle URLs.
# {{{ checkUsage()
checkUsage()
{
if [[ -z $1 ]]; then
cat << EOT
@BrandonMorr
BrandonMorr / restore-complete.sh
Last active October 12, 2018 17:43
This is a pretty cool script if you ask me.
#!/usr/bin/env bash
# Query params can be set here
QUERY='PID:*'
FILTER_QUERY='-fedora_datastreams_ms:"OBJ" AND +fedora_datastreams_ms:"MEDIUM_SIZE" AND +RELS_EXT_hasModel_uri_ms:"info:fedora/islandora:sp_basic_image"'
FILTER_RESULTS='PID'
WT='csv'
ROWS='100'
URL='http://localhost:8080/solr/collection1/select'
@BrandonMorr
BrandonMorr / keybase.md
Created February 6, 2018 18:15
Proof of Identity

Keybase proof

I hereby claim:

  • I am brandonmorr on github.
  • I am brandonmorr (https://keybase.io/brandonmorr) on keybase.
  • I have a public key whose fingerprint is B7ED A0F9 B220 4EC5 AB55 92C2 C871 563C 4C70 15CF

To claim this, I am signing this object:

<?php
$pids = array("islandora:9", "islandora:54", "islandora:58", "islandora:59", "islandora:60", "islandora:61");
$newCollection = 'islandora:sp_pdf_collection';
foreach($pids as $pid) {
$requires_rel = NULL;
$object = islandora_object_load($pid);
$result = $object->relationships->get(FEDORA_RELS_EXT_URI, 'isMemberOfCollection');
foreach($result as $results) {