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
server { | |
server_name www.goforself.me goforself.me; | |
listen 80; | |
client_max_body_size 20M; | |
port_in_redirect off; | |
access_log /var/log/nginx/goforself.me.access.log; | |
error_log /var/log/nginx/goforself.me.error.log error; | |
root /var/www/goforself; | |
index index.php; |
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.exports = { | |
email: { | |
address: 'youraddress@gmail.com', | |
password: 'clever-password' | |
} | |
}; |
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
const axios = require('axios'); | |
const querystring = require('querystring'); | |
const keys = require('../config/keys'); | |
const getAccessToken = async refreshToken => { | |
try { | |
const accessTokenObj = await axios.post( | |
'https://www.googleapis.com/oauth2/v4/token', | |
querystring.stringify({ | |
refresh_token: refreshToken, |
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
// using jQuery | |
$("#2020data").submit(function(e) { | |
$.ajax({ | |
url: "https://e0d92634.ngrok.io/test", | |
type: "POST", | |
data: new FormData(this), | |
processData: false, | |
contentType: false | |
}); |
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
const CDP = require('chrome-remote-interface'); | |
const chromeLauncher = require('chrome-launcher'); | |
const cheerio = require('cheerio'); | |
(async function() { | |
const launchChrome = () => | |
chromeLauncher.launch({ chromeFlags: ['--disable-gpu', '--headless'] }); | |
const chrome = await launchChrome(); | |
const protocol = await CDP({ port: chrome.port }); |
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
has_no_paypal_tag = Input.cart.line_items.any? { |line_item| line_item.variant.product.tags.include?('no-paypal') } | |
if has_no_paypal_tag | |
Output.payment_gateways = Input.payment_gateways.delete_if { |payment_gateway| payment_gateway.name.include?("PayPal") } | |
else | |
Output.payment_gateways = Input.payment_gateways | |
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
const express = require('express'); | |
const https = require('https'); | |
const fs = require('fs'); | |
const cors = require('cors'); | |
const rpn = require('request-promise-native'); | |
const bodyParser = require('body-parser'); | |
/* eslint-disable comma-dangle,arrow-parens,max-len,no-console */ | |
const app = express(); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Currency Conversion</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" | |
crossorigin="anonymous"> |
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
function getURL(startMatch, endMatch, str) { | |
var regex = new RegExp(startMatch + ': (.+), ' + endMatch); | |
var contents = str.split(regex)[1]; | |
return contents ? contents : 'none found'; | |
} | |
var str = 'website: http://www.google.com, soundcloud: http://www.soundcloud.com, facebook: http://www.facebook.com, stage: the main one'; | |
console.log('Website URL:', getURL('website', 'soundcloud', str)); |
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
// libraries | |
const express = require('express'); | |
const https = require('https'); | |
const fs = require('fs'); | |
const cors = require('cors'); // Cross-Origin Resource Sharing | |
// setup express | |
const app = express(); | |
app.use(cors()); |