Skip to content

Instantly share code, notes, and snippets.

View shreve's full-sized avatar

Violet Shreve shreve

View GitHub Profile

Keybase proof

I hereby claim:

  • I am shreve on github.
  • I am shreve (https://keybase.io/shreve) on keybase.
  • I have a public key whose fingerprint is F74D A565 C27E 38E2 FAE0 91A8 46E1 5CFC B828 6868

To claim this, I am signing this object:

@shreve
shreve / app-controllers-application_controller.rb
Last active August 29, 2015 14:04
Self-rolled authentication
class ApplicationController < ActionController::Base
before_action :session_hook
protected
# Models don't have access to the request's session, so we sneak it in here.
# Shh, don't tell anyone.
def session_hook
accessor = instance_variable_get :@_request
Session.send(:define_method, "session", proc { accessor.session })
Session.send(:define_method, "reset_session", proc { accessor.reset_session })
@shreve
shreve / response.json
Last active August 29, 2015 14:18
Protractor Response with Contacts and Invoices
{
"CRMDataSet":{
"xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance",
"xmlns:xsd":"http://www.w3.org/2001/XMLSchema",
"Header":{
"ErrorNumber":null,
"ErrorMessage":null
},
"Contacts":{
"Item":[
@shreve
shreve / pdfmarks
Last active August 5, 2023 06:44
Example of adding PDF metadata (bookmarks / ToC) with Ghostscript
[ /Title (Elementary Differential Equations)
/Author (Edwards & Penney)
/DOCINFO pdfmark
[ /Title (Contents)
/Page 6
/OUT pdfmark
[ /Count -8
/Title (1. First-Order Differential Equations)
runtime macros/matchit.vim
execute pathogen#infect()
let mapleader="," " <Leader> = ,
filetype plugin indent on
" Theming and shit like that
syntax on
set -g prefix C-a
set -g default-terminal "screen-256color"
set -g default-command "reattach-to-user-namespace fish"
bind C-a send-prefix
unbind C-b
# Set lines of history to scrollback
set -g history-limit 3000
# Make shift+arrows, ctrl+arrows etc work in Vim.
@shreve
shreve / .inputrc
Created December 25, 2016 03:28
OS X Inputrc
set completion-ignore-case on
set show-all-if-ambiguous on
set bell-style none
set editing-mode vi
# Make TAB cycle through possible completions
#TAB: menu-complete
@shreve
shreve / watson.rb
Created November 2, 2017 03:59
Early Watson Idea
#!/usr/bin/env ruby
require 'io/console'
require_relative 'ansi'
class App
attr_accessor :input
attr_accessor :selection
class << self
@shreve
shreve / ansi.rb
Last active November 5, 2017 20:54
# This module contains helpers for various ansi-code operations
module ANSI
# ANSI color escape codes set the foreground and background colors.
# Forground color is a number between 30 and 37.
# Background color is a number between 40 and 47.
# The ones place represents the same color for both.
COLORS = [:black, :red, :green, :yellow, :blue, :magenta, :cyan, :white, nil, :default].freeze
def self.clear_screen
$stdout.write "\e[2J"

Testing Wellopp Messenger

Managing Content

This set of actions requires a messenger_admin role.

  1. Click the "Messages" link at the bottom of the left bar
  2. See that your client name is displayed in the page header
  3. Click the "Add New Message" button