Skip to content

Instantly share code, notes, and snippets.

View pelargir's full-sized avatar

Matthew Bass pelargir

  • Adeptware, Inc.
  • Raleigh, NC
View GitHub Profile

Keybase proof

I hereby claim:

  • I am pelargir on github.
  • I am pelargir (https://keybase.io/pelargir) on keybase.
  • I have a public key ASAG6q9V4ZBTW4aU6v3eWeH_HCYt0mnMDrLCnnvuHQrIYAo

To claim this, I am signing this object:

== 20140614222207 MoveBlobsToS3: migrating ====================================
0 Printed Cases
PrintedCase#p: 100% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 0:00:00
0 Documents
Document#cont: 100% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 0:00:00
0 Batch Events
BatchEvent#ex: 100% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 0:00:00
@pelargir
pelargir / QRDA_Category_I_Release_2.sch
Created July 7, 2014 10:38
Schematron for QRDA Cat I files
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<sch:schema xmlns:voc="http://www.lantanagroup.com/voc" xmlns:svs="urn:ihe:iti:svs:2008" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cda="urn:hl7-org:v3" xmlns:sdtc="urn:hl7-org:sdtc" xmlns="urn:hl7-org:v3" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<sch:ns prefix="voc" uri="http://www.lantanagroup.com/voc" />
<sch:ns prefix="svs" uri="urn:ihe:iti:svs:2008" />
<sch:ns prefix="xsi" uri="http://www.w3.org/2001/XMLSchema-instance" />
<sch:ns prefix="cda" uri="urn:hl7-org:v3" />
<sch:ns prefix="sdtc" uri="urn:hl7-org:sdtc" />
<sch:phase id="errors">
<sch:active pattern="p-required-template-ids"/>
<sch:active pattern="p-sdtc-errors-code" />
class OmniauthCallbacksController < ApplicationController
def wordpress_oauth2
self.current_user = User.find_for_wordpress_oauth2(request.env['omniauth.auth'])
if current_user
flash[:notice] = "Logged in successfully"
current_user.record_login request.user_agent
else
flash.now[:error] = "Something went wrong (unable to login)"
end
@pelargir
pelargir / ss
Created December 13, 2012 15:56
launch Rails 2 or 3 server, or foreman if this is a Heroku app
if [ -f script/server ]
then
script/server
elif [ -f .env ]
then
foreman start -p 3000
else
script/rails server
fi
numbers = (0..99).to_a
while numbers.any? do
i = numbers.pop
`say "#{i} cans of coke in the fridge"`
`say "#{i} cans of coke"`
`say "take one out, pass it around"`
`say "#{i - 1} cans of coke in the fridge"`
end
<% if @user.role == "ADMIN" -%>
<span class="admin">Welcome Admin</span>
<% elsif @user.role == "USER" -%>
<span class="user">Welcome User</span>
<% else -%>
<span class="peon">Welcome Peon</span>
<% end -%>
$('#my_form').submit(function(event) {
$.ajax({
type: 'POST',
dataType: 'json',
data: $(event.target).serialize(),
url: event.target.action,
success: function(json) {
if (json['success'] == true) {
window.location = json['redirect_to'];
} else {