Skip to content

Instantly share code, notes, and snippets.

View kevinchugh's full-sized avatar

Kevin Chugh, Ph.D, Founder, Main Street Computing (mainstreetcomputing.com) kevinchugh

View GitHub Profile
drawing_node_raw = "
<w:drawing>
<wp:anchor behindDoc=\"0\" distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\" simplePos=\"0\" locked=\"0\" layoutInCell=\"1\" allowOverlap=\"1\" relativeHeight=\"2\">
<wp:simplePos x=\"0\" y=\"0\"/>
<wp:positionH relativeFrom=\"column\">
<wp:align>center</wp:align>
</wp:positionH>
<wp:positionV relativeFrom=\"paragraph\">
<wp:posOffset>635</wp:posOffset>
</wp:positionV>
ps -A|grep ruby
35010 ttys002 0:00.02 /Users/kevin/.rvm/gems/ruby-2.5.0/gems/rb-fsevent-0.9.8/bin/fsevent_watch --latency 0.1 /Users/kevin/.rvm/gems/ruby-2.5.0/gems/activesupport-5.0.2/lib/active_support/locale
35011 ttys002 0:00.02 /Users/kevin/.rvm/gems/ruby-2.5.0/gems/rb-fsevent-0.9.8/bin/fsevent_watch --latency 0.1 /Users/kevin/.rvm/gems/ruby-2.5.0/gems/activemodel-5.0.2/lib/active_model/locale
35012 ttys002 0:00.02 /Users/kevin/.rvm/gems/ruby-2.5.0/gems/rb-fsevent-0.9.8/bin/fsevent_watch --latency 0.1 /Users/kevin/.rvm/gems/ruby-2.5.0/gems/actionview-5.0.2/lib/action_view/locale
35013 ttys002 0:00.02 /Users/kevin/.rvm/gems/ruby-2.5.0/gems/rb-fsevent-0.9.8/bin/fsevent_watch --latency 0.1 /Users/kevin/.rvm/gems/ruby-2.5.0/gems/responders-2.4.0/lib/responders/locales
35014 ttys002 0:00.02 /Users/kevin/.rvm/gems/ruby-2.5.0/gems/rb-fsevent-0.9.8/bin/fsevent_watch --latency 0.1 /Users/kevin/.rvm/gems/ruby-2.5.0/gems/faker-1.7.3/lib/locales
Kevins-Macbook-Air:opencaseware kevin$ gem install bundler
ERROR: SSL verification error at depth 2: certificate has expired (10)
ERROR: Certificate /C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA expired at 2014-01-28T12:00:00Z
ERROR: SSL verification error at depth 2: certificate has expired (10)
ERROR: Certificate /C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA expired at 2014-01-28T12:00:00Z
ERROR: SSL verification error at depth 2: certificate has expired (10)
ERROR: Certificate /C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA expired at 2014-01-28T12:00:00Z
ERROR: Could not find a valid gem 'bundler' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=error: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
ERROR: SSL verification error at depth 2: certificate has expired (10)
@kevinchugh
kevinchugh / gist:13f8187d24551daf719d90dc728c368c
Created August 18, 2017 14:45
prefix and post fix debatcher
// prefix
@Override
public void onSubscriptionData(BotContext ctx, RtmSubscriptionData messages)
{
JsonArray msgJsonArray = messages.getMessages();
JsonArray msgs = msgJsonArray.get(0).getAsJsonArray();
for (JsonElement msg : msgs)
# in organization.rb:
def self_and_descendants
# simply return them in the order they should appear in the tree
answer = []
answer << self
answer += Organization.where(parent_organization_id: self.id).
sort_by{|x| x.description}.self_and_descendants # may have to use authorized instead of .all
end
<div id = "fields">
<input type="hidden" value="58dd33e8d036690d0ae9a670" name="child_cases[case_type_id]" id="child_cases_case_type_id" />
<input value="58dd3a8cd036690d0ae9aa08" type="hidden" name="child_cases[parent_case]" id="child_cases_parent_case" />
<input type="hidden" value="58dd33e8d036690d0ae9a671" name="child_cases[case_type_field_set_data_sets_attributes][0][case_type_field_set_id]" id="child_cases_case_type_field_set_data_sets_attributes_0_case_type_field_set_id" />
<div class="panel panel-default">
<div class="panel-heading">
<h4> ref </h4>
</div>
<div class="panel-body">
<html><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link href="http://bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet">
<style>
table, table td {table-layout:fixed;word-wrap:break-word;}
.invoice-title h2, .invoice-title h3
{
display: inline-block;
Id: 11173422
Rcvr: 1
HasSig: true
Sig: 46
Icao: AA7E2E
Bad: false
Reg: N77510
FSeen: "/Date(1478109264402)/"
TSecs: 1582
CMsgs: 592
def goto
begin
question = Question.find params[:question][:question_number] # find will throw an exception if not found
redirect_to question # redirecting to an object will take you to the show page for that object
rescue
flash[:notice] = "sorry, error"
redirect_to :index
end
// IOS set up the login screen
-(void) dwollaConnect {
NSArray *scopes = @[@"send", @"balance", @"accountinfofull", @"contacts", @"funding", @"request", @"transactions"];
_client = [[DwollaOAuth2Client alloc] initWithFrame:CGRectMake(0, 0, 320, 460) key:k_DWOLLA_KEY secret:k_DWOLLA_SECRET redirect:k_DWOLLA_REDIRECT_URL response:@"code" scopes:scopes view:self.view reciever:self];
[_client login];
}
# this is the ruby / rails code that receives the dwolla callback