This file contains hidden or 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
server.use( | |
createShopifyAuth({ | |
apiKey: SHOPIFY_API_KEY, | |
secret: SHOPIFY_API_SECRET, | |
scopes: [SCOPES], | |
async afterAuth(ctx) { | |
//Auth token and shop available in session | |
//Redirect to shop upon auth | |
const { shop, accessToken } = ctx.session; |
This file contains hidden or 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
theme.ShippingBar = (function(theme) { | |
var bar = document.querySelector('.announcement-bar'); | |
if(bar) | |
{ | |
var promote_txt = bar.dataset.promote; | |
var unlocked_txt = bar.dataset.unlocked; | |
var treshold = bar.dataset.treshold; | |
} | |
function update() | |
{ |
This file contains hidden or 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
/** | |
How to use: | |
let m = new Map(); | |
m.set(1, 1); | |
m.set(2, 2); | |
// Map(2) {1 => 1, 2 => 2} | |
let n = m.map((key, value) => value * 2); | |
// Map(2) {1 => 2, 2 => 4} |
This file contains hidden or 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
int i; | |
for(i = 1; i <= 100; i++) { | |
printf("%d\n", i); | |
} |
This file contains hidden or 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
# Usage: `docker build --build-arg RAILS_MASTER_KEY=$RAILS_MASTER_KEY -t myapp . | |
FROM ruby:2.6.2-slim | |
ARG RAILS_MASTER_KEY | |
# Install NodeJS | |
RUN apt-get update \ | |
&& apt-get install -y apt-transport-https curl gnupg2 \ | |
&& curl --silent --show-error --location https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ | |
&& echo "deb https://deb.nodesource.com/node_6.x/ stretch main" > /etc/apt/sources.list.d/nodesource.list \ |
This file contains hidden or 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
https://13.229.228.16?otp=0cb7f2da1194f554d34113cd2c88d960ab42984818e7b8d9641052d7f79f6669 |
This file contains hidden or 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
version: '3' | |
services: | |
postgres: | |
container_name: postgres | |
image: postgres:9.5.2 | |
ports: | |
- "5432:5432" | |
volumes: | |
- /Users/ardeearam/Docker/postgres:/var/lib/postgresql/data | |
environment: |
This file contains hidden or 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
#start of with a (hopefully) working Rails Settings | |
settings = ActionMailer::Base.smtp_settings | |
#Change credentials that you want to test | |
settings[:user_name] = "[email protected]" | |
settings[:password] = "Password" | |
settings[:key] = "Password" #For TLS, this is usually the same with password | |
envelope_from = "[email protected]" #For most SMTP servers, this should be consistent | |
destinations = "[email protected],[email protected]" | |
message = <<< MESSAGE |
This file contains hidden or 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
--http://stackoverflow.com/a/17298994/95552 | |
--Generate lookup | |
create table work_minutes ( | |
work_minute timestamp primary key | |
); | |
insert into work_minutes | |
select work_minute | |
from | |
(select generate_series(timestamp '2016-01-01 00:00:00', timestamp '2016-12-31 11:59:00' - interval '1 minute', '1 minute') as work_minute) t |
This file contains hidden or 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
1.upto 100 do | |
sample_question = Question.where(description: "8000").sample | |
puts sample_question.id | |
entity_outcome = sample_question.entity_outcome | |
if entity_outcome.nil? | |
puts "Error!" | |
break | |
elsif entity_outcome.result != "Abnormal" or entity_outcome.risk_point != 21 | |
puts "Error!" | |
break |