$ uname -r
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
FROM crystallang/crystal:0.34.0 as builder | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends build-essential \ | |
apt-transport-https curl ca-certificates gnupg2 apt-utils | |
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \ | |
&& apt-get install -y nodejs | |
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ |
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
We develop locally on MacOS. Due to some issues with cross compilation, we build the crystal binary on docker locally, | |
then zip that up and ship that along with the docker stuff to elasticbeanstalk. |
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
FROM crystallang/crystal:0.27.2 | |
WORKDIR /opt/src | |
# Install nodejs | |
COPY bin ./bin | |
RUN bin/nodesource_11.x | |
RUN apt-get update && apt-get install -y nodejs | |
# npm install |
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 babel from 'rollup-plugin-babel'; | |
import eslint from 'rollup-plugin-eslint'; | |
import resolve from 'rollup-plugin-node-resolve'; | |
import multiEntry from 'rollup-plugin-multi-entry'; | |
import uglify from 'rollup-plugin-uglify'; | |
import filesize from 'rollup-plugin-filesize'; | |
import commonjs from 'rollup-plugin-commonjs'; | |
import progress from 'rollup-plugin-progress'; | |
let pluginOptions = [ |
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
defmodule Shopify.Oauth do | |
@moduledoc """ | |
An OAuth2 strategy for Shopify. | |
Based on the OAuth2 strategy for GitHub by Sonny Scroggin | |
in https://github.com/scrogson/oauth2_example | |
""" | |
use OAuth2.Strategy | |
alias OAuth2.Strategy.AuthCode | |
alias OAuth2.Request |
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
<!--create a semi-random number using the last second of the send date--> | |
{% capture time_seed %} | |
{{ 'now' | date: "%s" }} | |
{% endcapture %} | |
<!--manupulate using lots of maths--> | |
{% assign random = time_seed | times: 1103515245 | plus: 12345 | divided_by: 65536 | modulo: 32768 | modulo: 10 %} | |
<!--return number--> | |
{{ random }} |
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
task :environment do | |
require './dj-sinatra' | |
end | |
namespace :jobs do | |
desc "Clear the delayed_job queue." | |
task :clear => :environment do | |
Delayed::Job.delete_all | |
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
# Update, upgrade and install development tools: | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y install build-essential git-core curl libssl-dev \ | |
libreadline5 libreadline5-dev \ | |
zlib1g zlib1g-dev \ | |
libmysqlclient-dev \ | |
libcurl4-openssl-dev \ | |
libxslt-dev libxml2-dev |
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
def self.read_barcode_from_image path | |
# Call the barcode reader - and get a response of multiple lines | |
ls = `/usr/bin/zbarimg '#{path}'`.lines | |
# Handle a variety of unexpected responses that we have seen and debugged quickly over time | |
ls = [ls] if ls.is_a?(String) | |
barcodes = [] | |
return barcodes if ls.nil? || ls == 0 | |
NewerOlder