Skip to content

Instantly share code, notes, and snippets.

View rymohr's full-sized avatar

Ryan Mohr rymohr

View GitHub Profile

Keybase proof

I hereby claim:

  • I am rymohr on github.
  • I am rymohr (https://keybase.io/rymohr) on keybase.
  • I have a public key ASBEHv6nr_AplSExST7w3aAhcEV-xQUXBSrbSo6XNj0NyAo

To claim this, I am signing this object:

@rymohr
rymohr / DreamList.jsx
Created July 16, 2015 20:19
How I wish I could write React components
class DreamList extends React.Component {
// Would love to be able to write inline SCSS/LESS
// and have it automatically injected into the document
// when the component was required.
<style>
.dream-list {
margin: 0;
padding: 0;
list-style: none;

Create a new map in Kumu, open up the javascript console, and point the map at the blueprint:

Workflows.setCurrentMapSource("https://example.com/path/to/blueprint.json");

For example, if you wanted to load the blueprint below you would use

Workflows.setCurrentMapSource("https://gist.githubusercontent.com/rymohr/06533f749645f13c7732/raw/420f21f74b6de68485347af058f1a3f8b12b89a9/simple-kumu-blueprint.json");
@rymohr
rymohr / sanitizeHtml.js
Created March 5, 2014 18:11
browserified sanitize-html
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.sanitizeHtml=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
var htmlparser = _dereq_('htmlparser2');
var _ = _dereq_('lodash');
var ent = _dereq_('ent');
module.exports = sanitizeHtml;
function sanitizeHtml(html, options) {
var result = '';
if (!options) {
@rymohr
rymohr / migrate-yaml-store-to-json.rb
Last active July 21, 2023 09:56
Simple template for migrating your rails ActiveRecord::Store's from YAML to JSON
# Override your existing class with a simple replacement class
class Token < ActiveRecord::Base
end
class ConvertStoresToJson < ActiveRecord::Migration
def process(value)
if value && !value.starts_with?("{")
result = YAML.load(value).to_json
else
result = value