Skip to content

Instantly share code, notes, and snippets.

View tofumatt's full-sized avatar

Matthew Riley MacPherson tofumatt

View GitHub Profile
class PostingsController < ApplicationController
after_action :verify_authorized, except: [:index, :archived]
after_action :verify_policy_scoped, only: [:index, :archived]
before_action :require_login
def index
@sortorder = params[:sort]
case @sortorder
when 'date-added'
@method = :order, 'created_at DESC'
arr = new Uint8Array(8)
dump(arr instanceof Uint8Array) // emits TRUE
localforage.setItem('Uint8Array', arr).then (writeValue) ->
..
// in localstorage.js file
function setItem(key, value, callback) {
__utils__.echo(arr instanceof Uint8Array); // emits FALSE