Skip to content

Instantly share code, notes, and snippets.

View liesislukas's full-sized avatar
🚀
Excited

Lukas Liesis liesislukas

🚀
Excited
View GitHub Profile
@liesislukas
liesislukas / Caddyfile
Created March 18, 2024 07:19 — forked from lopezjurip/Caddyfile
Fix Too Many Redirect error using Caddy + Cloudflare
www.mysite.com, mysite.com {
proxy / webapp:3000 {
proxy_header Host {host}
proxy_header X-Real-IP {remote}
proxy_header X-Forwarded-Proto {scheme}
}
gzip
tls your@email.com
}

From: https://beta.psy-dreamer.com/category/automation/deploying-from-github-to-vps-using-travis-ci

Recently, I spent around 14 to 16 hours learning all of the necessary steps to getting an existing repo set up with Travis CI to run unit tests, and then once successful, connect to a remote server that isn't a PaaS (in this case, Linode) and then proceeds to use Git hooks to do post deployment things.

Starting with your local machine and you have your project already checked out from Github.

Setting Up

  • Assuming you have Ruby (at least 2.3.1) installed, run gem install travis. This installs the Travis CI command-line tools. We're going to use these tools to encrypt RSA keys that Travis will use to connect to your remote server.
  • This tutorial also assumes that you have a working repo and a Travis-CI account set up.
@liesislukas
liesislukas / paypal sample create order with items.js
Created August 9, 2019 09:43
Working PayPal order capture sample code. JavaScript. createOrder with items
paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [
{
reference_id: "PUHF",
description: "Some description",
custom_id: "Something7364",
soft_descriptor: "Great description 1",
@liesislukas
liesislukas / index.js
Created January 28, 2022 14:58
Framer component to zip
const fs = require("fs");
const path = require("path");
const del = require("del");
const util = require("util");
const exec = util.promisify(require("child_process").exec);
const readFile = util.promisify(fs.readFile);
const writeOutput = require("./writeOutput");
const express = require("express");
const axios = require("axios");
const app = express();
@liesislukas
liesislukas / index_item.js
Created December 9, 2021 11:34
opensearch_sample_codes
var AWS = require('aws-sdk');
var region = 'us-east-1'; // e.g. us-west-1
var domain = 'search-boringgrowth-production-i6qoaz4c44rfxl25pkiwtvwgvm.us-east-1.es.amazonaws.com'; // e.g. search-domain.region.es.amazonaws.com
var index = 'lukas';
var type = '_doc';
var id = '1';
var json = {
@liesislukas
liesislukas / getAvailableCountries()
Created December 31, 2015 13:35
all countries list in js array
getAvailableCountries(){
return [
{country_code: "US", country_name: "United States"},
{country_code: "CA", country_name: "Canada"},
{country_code: "GB", country_name: "United Kingdom"},
{country_code: "AU", country_name: "Australia"},
{country_code: "DE", country_name: "Germany"},
{country_code: "AX", country_name: "Åland Islands"},
{country_code: "AF", country_name: "Afghanistan"},
{country_code: "AL", country_name: "Albania"},
@liesislukas
liesislukas / plambda.yaml
Created September 29, 2021 05:53 — forked from sihil/plambda.yaml
Snippet of some CloudFormation resources for Plambda
API:
Type: AWS::ApiGateway::RestApi
Properties:
Name:
Fn::Join:
- " "
- - Restorer Plambda
- Ref: Stage
Description: Experimental Restorer Play app in Lambda
@liesislukas
liesislukas / .eslintrc.js
Created September 3, 2021 06:06
Eslint rules to work next to prettier. I use prettier's default to format everything and eslint to highlight code issues.
module.exports = {
env: {
browser: true,
es6: true,
node: true,
commonjs: true,
},
extends: ["eslint:recommended", "plugin:react/recommended"],
globals: {
Atomics: "readonly",
@liesislukas
liesislukas / post_install_script.js
Created August 24, 2021 10:42
reactjs app webpack dev server file watch delay fix for react-scripts
/*
In package.json:
"postinstall": "node ./extras/post_install_script.js"
*/
const fs = require("fs");
const path = require("path");
const _filePath = path.join(__dirname, "../node_modules/react-scripts/config/webpackDevServer.config.js");
version: 0.2
env:
variables:
PORT: "2000"
REACT_APP_ENV: "production"
REACT_APP_TITLE: "My App"
REACT_APP_FAVICON: "favicon.ico"
REACT_APP_LOGO_TYPE: "vertical"
phases:
install: