Skip to content

Instantly share code, notes, and snippets.

View pyrabbit's full-sized avatar

Matthew Orahood pyrabbit

View GitHub Profile
@pyrabbit
pyrabbit / access_keys_controller.rb
Created September 25, 2019 13:26
API Gateway Rails Controller Implementation
module Enterprises
class AccessKeysController < DashboardsController
def create
gateway = Aws::APIGateway::Client.new
begin
api_key = create_api_key!(gateway, current_enterprise, params[:stage])
current_enterprise.update_stage_key!(api_key: api_key, stage: params[:stage])
redirect_to enterprises_access_keys_path
{
"Id"=>13730,
"ActivityId"=>12008,
"ActivityTypeId"=>4,
"ActivityTypeName"=>"Lab",
"ParentId"=>nil,
"Activities"=>[],
"Subtitle"=>"Virtual Server Connectivity Check, Module 01 Lab1",
"Description"=>
"In this lab you will discover the various components of the Lab On Demand (LOD) interface and learn how to interact with the controls to sucessfully complete your hands-on online labs.",
@pyrabbit
pyrabbit / new_core_data_stack.swift
Created March 22, 2017 15:04
Core Data migration problem
// New Core Data Stack for iOS 9+ inspired by https://useyourloaf.com/blog/easier-core-data-setup-with-persistent-containers/
lazy var applicationDocumentsDirectory: URL = {
// The directory the application uses to store the Core Data store file. This code uses a directory named "com.cadiridris.coreDataTemplate" in the application's documents Application Support directory.
let urls = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)
return urls[urls.count-1]
}()
lazy var managedObjectModel: NSManagedObjectModel = {
// The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model.
Incident Identifier: 06AD3CCD-00BC-4D58-8C36-46E7ED875AB9
Beta Identifier: C0EFAAE0-9A8D-420D-ACFE-EF369CF73A4F
Hardware Model: iPhone8,2
Process: ConsultantAide [7396]
Path: /private/var/containers/Bundle/Application/812BACBE-CB30-497A-96C0-8E10B820C76F/ConsultantAide.app/ConsultantAide
Identifier: com.mattorahood.ConsultantAide
Version: 5 (1.3.2)
Beta: YES
Code Type: ARM-64 (Native)
Role: Foreground
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.mattorahood.coolcalc, PID: 4008
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mattorahood.coolcalc/com.mattorahood.coolcalc.MainActivity}: android.view.InflateException: Binary XML file line #167: Binary XML file line #167: Error inflating class <unknown>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
//
// StylePickerViewController.swift
// ConsultantAide
//
// Created by Matt Orahood on 5/28/16.
// Copyright © 2016 Matt Orahood. All rights reserved.
//
import UIKit
import CoreData
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
updateStylesFromServer()
return true
}
// MARK: - Remote Style Updating
func updateStylesFromServer() {
Alamofire.request(.GET, "https://consultant-aide.firebaseio.com/brands/lularoe.json")
.responseJSON { response in
@pyrabbit
pyrabbit / string_replace.rb
Last active September 16, 2015 13:58
This is an example showing how the String#replace method retains the same object id after being called.
> a = "This is a cat"
=> "This is a cat"
> a.__id__
=> 7971260
> b = "This is a dog"
=> "This is a dog"
> b.__id__
=> 7965700
> a = b.replace("This is a bird")
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Matt\'s Application',
appVersion: '1.3.4'
});
@pyrabbit
pyrabbit / browser-mockup.png
Created August 29, 2015 02:55 — forked from jarthod/browser-mockup.png
Pure CSS browser mockups
browser-mockup.png