This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Must me NUMBER or CHAR if you want to print it. Printing a VARCHAR is too complex for expensive databases like Oracle. | |
VARIABLE r CHAR (1000); | |
BEGIN | |
-- := is for assignment. vs = for equality | |
-- bind variables are prefixed with a colon | |
-- BANIST1 is the instance | |
-- BSK_INFO_REQUEST is the package | |
-- get_prel_codes() is the function | |
:r := BANINST1.BSK_INFO_REQUEST.get_prel_codes(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def batch_session_prune(keep_after = 1.month.ago, batch_by = 1.day, pause_time = 10) | |
time = ActiveRecord::SessionStore::Session.order(:updated_at).first[:updated_at] | |
while time < keep_after | |
time = time + batch_by | |
puts "Deleting sessions from #{time.to_s(:short)}" | |
ActiveRecord::SessionStore::Session.where('updated_at < ?', time).delete_all | |
sleep pause_time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description "faye" | |
version "1.0" | |
author "Adam Crownoble" | |
env LANG=en_US.UTF-8 | |
env APP_ROOT=/srv/rack/faye-server | |
start on startup | |
stop on shutdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LocalODServer | |
attr_accessor :username, :password | |
def initialize(username, password) | |
@username = username | |
@password = password | |
end | |
def ip | |
'127.0.0.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { margin: 0; } | |
html, body { height: 100%; font-family: Arial, Helvetica, sans-serif; } | |
body { background: #f5f5f5; } | |
img { border-style: none; font-weight: normal; } | |
a:link, a:visited { color: #009; font-weight: bold; text-decoration: none; } | |
a:hover, a:active { color: #6cb33f; font-weight: bold; text-decoration: none; outline: none; } | |
a:focus, a:active { outline: none; } | |
:focus { outline-style: none; } | |
.clear { clear: both; margin: 0px; padding: 0px; height: 1px; } | |
p { color: #333; margin: 0px 0px 5px; font-size: 0.8em; display: block; width: 100%; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'csv' | |
file = ARGV.first | |
TABLE = 'everbridge_user' | |
date_modified = Time.now.strftime '%Y-%m-%d %H:%M:%S' | |
CSV.foreach(file, headers: :first_row) do |row| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# elasticsearch: Version: 2.3.3, Build: 218bdf1/2016-05-17T15:40:04Z, JVM: 1.8.0_92 | |
# Arch Linux | |
# Kernel version 4.4.3-1-custom | |
# Setup a basic index using an edgengram filter | |
curl -XPUT "http://localhost:9200/test_index?pretty=true" -d' | |
{ | |
"settings": { | |
"analysis": { | |
"filter": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#vue-job-requirements-app data-job-requirements=job_requirements_json(@job_role.job_requirements) | |
.form-group v-for="req in requirements" | |
input type="hidden" name="job_role[job_requirements_attributes][{{ $index }}][id]" value="{{ req.id }}" | |
input type="hidden" name="job_role[job_requirements_attributes][{{ $index }}][_destroy]" value="{{ req._destroy }}" | |
.input-group v-if="req._destroy != '1'" transition="fade-out" | |
input.form-control type="text" name="job_role[job_requirements_attributes][{{ $index }}][description]" value="{{ req.description }}" | |
.input-group-addon v-on:click="removeRequirement($index)" | |
i.fa.fa-times.text-danger | |
button.btn.btn-success.btn-xs type="button" v-on:click="addRequirement()" | |
i.fa.fa-plus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run with command: | |
# CAS_SERVER="http://example.com/login" rackup | |
require 'sinatra/base' | |
require 'rack/cas' | |
require 'yaml' | |
class SinatraRackCASExample < Sinatra::Base | |
before do | |
unless session['cas'] && session['cas']['user'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < CouchRest::Model::Base | |
self.database = server.database('_users') | |
def self.model_type_value() 'user' end | |
property :name | |
property :password | |
property :roles | |
property :_id | |
before_save :generate_id, :assign_admin_role |