Skip to content

Instantly share code, notes, and snippets.

View caseyli's full-sized avatar

Casey Li caseyli

View GitHub Profile

How to run Rails in production mode

Add production secret key

  1. EDITOR=vi rails credentials:edit --environment production
  2. The document that pops up, add one line to secret_key_base: <whatever you want> at the root level
  3. Save file.

Create Production Database

@caseyli
caseyli / freshbooks_api_client.js
Last active February 27, 2021 18:33
A simple JavaScript object to manage Freshbooks API calls from an Expo / React Native App
import axios from 'axios';
import Constants from 'expo-constants';
import environment from './environment';
import * as AppAuth from 'expo-app-auth';
import * as Linking from 'expo-linking';
import * as SecureStore from 'expo-secure-store';
import moment from 'moment';
import apiClient from './api_client';
import appSettings from '../../app.json';
@caseyli
caseyli / application_helper.rb
Created April 9, 2014 14:48
Rest In Place Helper that takes Authorization into account
module ApplicationHelper
# This helper will basically create a rest-in-place spans around your content, but will prevent it from being active if editable is false
def rest_in_place(text, attribute, editable)
css_class = "rest-in-place" if editable
content_tag(:span, data: { attribute: attribute }, class: css_class) do
text
end
end
end