Skip to content

Instantly share code, notes, and snippets.

View richardcalahan's full-sized avatar
🎯
Focusing

Richard Calahan richardcalahan

🎯
Focusing
View GitHub Profile
@richardcalahan
richardcalahan / lakeandskye.test
Last active September 21, 2023 13:49
lakeandskye.test
server {
listen 80;
server_name api.lakeandskye.test;
return 301 https://api.lakeandskye.test$request_uri;
}
server {
listen 80;
server_name cms.lakeandskye.test;
return 301 https://cms.lakeandskye.test$request_uri;
@richardcalahan
richardcalahan / commoncitizen.test
Created March 9, 2022 13:31
Craft CMS - NGINX
server {
listen 80;
server_name api.commoncitizen.test;
return 301 https://api.commoncitizen.test$request_uri;
}
server {
listen 80;
server_name cms.commoncitizen.test;
return 301 https://cms.commoncitizen.test$request_uri;
import Promise from 'bluebird'
import Cookies from 'js-cookie'
export const init = () => {
return Promise.map(window.vinoshipper.accounts, account => {
return $
.get(`https://vinoshipper.com/json-api/v2/wine-list?id=${account.id}`)
.then(data => {
account.shipsTo = data.shipsTo
account.wines = data.wines
@richardcalahan
richardcalahan / checkout.tag
Last active October 30, 2020 21:37
Lake and Skye - Narritiv Checkout Script
<script type="text/javascript">
var productsPurchased = [];
var orderTotal = 0;
{% for item in checkout.order.line_items %}
productsPurchased.push({
product_id: '{{ item.variant_id }}',
product_name: '{{ item.title }}',
product_brand: '{{ item.vendor }}',
product_size: '{{ item.grams }}',
product_price: '{{ item.final_price }}',
@richardcalahan
richardcalahan / new.js
Last active June 23, 2020 17:49
userCreateProps
exports.userCreateProps = functions.auth.user().onCreate( (user) => {
const props = {};
props["email"] = user.email;
if ( user.displayName ) {
props["displayName"] = user.displayName;
}
if ( user.phoneNumber ) {
props["phoneNumber"] = user.phoneNumber;
{
"development": {
"shopify_api_key":"[your key]",
"shopify_password":"[your password]",
"shopify_url":"[your dev shop url]",
"shopify_theme":"[the theme id to sync to]"
}
}
@richardcalahan
richardcalahan / README
Created April 24, 2012 21:13
PhoneGap HTML config
NOTES!
This is the single html page to be loaded by phonegap.
The only elements to be hard coded are the initial host locations for the
css/js assets. Currently set to my rails app on the network.
(note, localhost won't work in development. Must be an explicit IP)
In a phonegap app, we have to explicitly declare a host for all ajax request.
This is because the main html page is not being served from a web server.
@richardcalahan
richardcalahan / example.js
Created April 5, 2012 22:08
Prevent iOS WebApp links from opening in Safari
$(document).ready(function() {
$('a').live('click', function (e) {
e.preventDefault();
window.location = $(this).attr('href');
});
});
@richardcalahan
richardcalahan / README
Created February 7, 2012 19:34
Calendar Generator class prototype
## NOTE
Class assumes event model includes start_date and end_date,
both of type 'datetime'.
You can init the class with a hash of options.
There are two options options at this point, 'month_format',
and 'date_format' which accept Ruby's 'strftime' style strings.