Attribute | Type | Description |
---|---|---|
version |
int |
The version of the photo collection, will increase as modifications are made |
collectionUUID |
string |
A unique identifier for the collection, it will remain the same with subsequent versions |
title |
string |
The title of the collection |
subtitle |
string |
The subtitle of the collection |
description |
string |
The long description explaining the project |
categories |
Array |
A list of categories the user applied to the collection |
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
module Searchkick | |
class AsyncReindexStatus | |
include Redis::Objects | |
def id | |
'searchkick-async-reindex-status' | |
end | |
list :currently_reindexing | |
end |
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
import React, { useMemo } from 'react'; | |
import { | |
Document as PDFDocument, | |
StyleSheet, | |
Page, | |
Font, | |
} from '@react-pdf/renderer'; | |
import dig from 'lodash.get'; | |
import PageFooter from './PageFooter'; | |
import CoverPage from './CoverPage'; |
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
require 'oauth2' | |
client_id = 'your_client_id' | |
client_secret = 'your_client_secret' | |
redirect_uri = 'https://yoursite.com/oauth/authorize' | |
site = 'https://app.companycam.com' | |
client = OAuth2::Client.new(client_id, client_secret, site: site) | |
auth_url = client.auth_code.authorize_url(redirect_uri: redirect_uri, scope: 'read write destroy') |
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
$provider = new \League\OAuth2\Client\Provider\GenericProvider([ | |
'clientId' => '', // Your client ID | |
'clientSecret' => '', // Your secret key | |
'redirectUri' => 'https://lonestarhazmatapp.com/wp-json/moserver/authorize', // This is where we redirect you/the user after they say it is okay for you to access CompanyCam on their behalf | |
'urlAuthorize' => 'https://app.companycam.com/oauth/authorize', | |
'urlAccessToken' => 'https://app.companycam.com/oauth/token' | |
]); | |
// If we don't have an authorization code then get one | |
// This would be in the Wordpress Admin UI, hook it up to a button or something |
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 BaseController < ApplicationController | |
before_action :doorkeeper_authorize!, except: [:index, :show, :create, :update, :destroy] # Anything not caught below | |
before_action :authorize_read_actions!, only: [:index, :show] | |
before_action :authorize_write_actions!, only: [:create, :update] | |
before_action :authorize_destroy_actions!, only: [:destroy] | |
def current_user | |
unless defined?(@current_user) | |
if doorkeeper_token.present? && !doorkeeper_token.revoked? | |
@current_user ||= User.find_by(id: doorkeeper_token.resource_owner_id) |
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
client = OAuth2::Client.new(ENV['COMPANYCAM_UID'], ENV['COMPANYCAM_SECRET'], site: 'https://app.companycam.com') | |
# Get a auth URL to redirect user to | |
client.auth_code.authorize_url(redirect_uri: 'https://yoursite.com/oauth/companycam/callback') | |
# The user will accept of deny and then be redirected to the URL above | |
# the URL will have a parameter `code` if the user accepted. | |
# You will take the code and POST back to exchange for an access_token and refresh_token | |
client.auth_code.get_token(params[:code], redirect_uri: 'https://yoursite.com/oauth/companycam/callback') |
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
[Unit] | |
Description=Puma HTTP Server for <%= "#{fetch(:application)} (#{fetch(:stage)})" %> | |
After=network.target | |
Requires=puma.socket | |
[Service] | |
Type=simple | |
User=<%= fetch(:deploy_user) %> | |
Environment=RAILS_ENV=<%= fetch(:rails_env) %> |
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
// project will be https://docs.companycam.com/#the-project-object | |
const project = await fetch ('https://api.companycam.com/v2/projects', { | |
headers: { | |
'Accept': 'application/json', | |
'Content-Type': 'application/json', | |
'Authorization': 'Bearer {access_token}, | |
'X-CompanyCam-User': '{user_email}', | |
'X-CompanyCam-Secret': '{application_secret}' | |
}, |
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
// Set secret key for your application globally | |
CompanyCamConfiguration.SetSecretKey("YourSecretKey"); | |
var requestOptions = new CompanyCamRequestOptions | |
{ | |
ApiKey = "CompanyApiKey", | |
UserEmailAddress = "UserPerformingAction" | |
}; | |
var projectService = new ProjectService(requestOptions); | |
var project = projectService.Create(new Project |
NewerOlder