Skip to content

Instantly share code, notes, and snippets.

@bemosior
bemosior / wardley.js
Last active February 8, 2020 18:58
An attempt to codify the strategy cycle.
/*
The Wardley Mapping Operating System
https://medium.com/wardleymaps
Courtesy of Simon Wardley, CC BY-SA 4.0
Codified by Ben Mosior, CC BY-SA 4.0
https://creativecommons.org/licenses/by-sa/4.0/legalcode
*/
// https://learnwardleymapping.com/home/climate/
@bemosior
bemosior / gist:1ec84cb2fe07205addd192fdb7d7c12d
Last active February 17, 2020 01:02
WordPress Divi Button Date Localization
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.27/moment-timezone-with-data-2012-2022.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jstimezonedetect/1.0.7/jstz.min.js"></script>
<script>
localizeTime("et_pb_button_one","2020-02-20 17:00",true);
localizeTime("et_pb_button_two","2020-02-05 22:00",false);
function localizeTime(buttonClass, timeString, full) {
if (!sessionStorage.getItem('timezone')) {
@bemosior
bemosior / carrierwave_content_type.rb
Last active August 22, 2016 03:59 — forked from mehlah/carrierwave_content_type.rb
CarrierWave test script for issue #1864
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails'
@bemosior
bemosior / gist:575a42de1a44cffb250d
Last active August 29, 2015 14:10
Mathematic Parallel Graph Export
ParallelDo[
Export[
StringJoin["/path/destination/exported_", i, ".png"],
ListLinePlot[Import[StringJoin["/path/source/imported_", i, ".csv"], "CSV"]]
],
{i, {"256", "512", "1024", "2048", "4096"} }
]
@bemosior
bemosior / minion_config
Last active August 29, 2015 14:08
IaC Development Workflow - minion_config
# Some of the minion_config file for context.
# Configure the vagrant minion to believe it is itself the master
master: localhost
# Configure the id of the minion. This is how you trick your VM into
# thinking it is a production system.
id: someserver
file_roots:
@bemosior
bemosior / Vagrantfile
Last active August 29, 2015 14:08
IaC Development Workflow - Vagrantfile
# Some of the adjusted Vagrantfile for context.
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise64"
# ...
@bemosior
bemosior / Vagrant_Init
Last active August 29, 2015 14:08
IaC Development Workflow - Vagrant Init
# Let's assume my SaltStack code is in a folder called `salt-code` and it contains
# `formulas`, `pillar`, `salt`, and `vagrant` folders. We're going to get started
# with a basic Ubuntu 12.04 box (in Vagrant Cloud as hashicorp/precise64).
$ cd salt-code/vagrant
$ vagrant init hashicorp/precise64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
@bemosior
bemosior / your_import.properties
Created May 9, 2014 13:05
MultiBackend Import Process
# Properties for the Java import program
# $Id: vufind_config.properties $
# solrmarc.solr.war.path - must point to either a war file for the version of Solr that
# you want to use, or to a directory of jar files extracted from a Solr war files. If
# this is not provided, SolrMarc can only work by communicating with a running Solr server.
# IMPORTANT NOTE FOR WINDOWS USERS:
# Use forward slashes, not back slashes (i.e. c:/vufind/..., not c:\vufind\...)
solrmarc.solr.war.path=/usr/local/vufind/solr/jetty/webapps/solr.war
@bemosior
bemosior / MultiBackend.php
Last active August 29, 2015 14:01
VuFind ILS Driver Extension
<?php
/**
* Multiple Backend Driver.
*
* PHP version 5
*
* Copyright (C) The National Library of Finland 2012.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@bemosior
bemosior / casLoginView.jsp
Last active December 28, 2015 08:49
Jasig CAS + Ektron CMS integration for Shippensburg University of Pennsylvania
<!-- Jasig CAS + Ektron CMS integration for Shippensburg University of Pennsylvania -->
<!-- Assumes the use of jQuery and Twitter Bootstrap 3 -->
<div class="col-md-12" id="ajax-announcements">
<!-- Announcements -->
</div>
<div class="panel-body" id="ajax-information">
<!-- Introduction / Information with a spinner image placeholder -->