fabiochiu/medium-articles huggingface dataset:
Gratitude Poetry from Year of The Poet (Vol 47)
By: Kimberly Burnham
Tags: Gratitude, Thanksgiving, Poetry, The Year Of The Poet, Culture

Featured in The Year of the Poet November, 2017 Volume 47.

Sensational Gratitude

Appreciate

palms together upraised

hands cooking writing

waving hugging

wrapping the world in love

experiencing delight

in peaceful touch

sought in dreams

found in every day

Gratitude for sounds

read aloud

I love you

you won

the breeze waving trees

footsteps

movement

life returning again and again

giving voice to dreams

spoken into reality

Thankfulness

see a genuine smile

lips moist

kissed by sunlight

a story poem

green branches winding

through the natural world

a tree

reaches for dreams

perceived at night

realized in morning light

Taste Treasures poetry with Kimberly Burnham. Spices Photo by Andrea Leon on Unsplash

Taste Treasures

Subtle spices

travelling far

cultures blending seamlessly

chocolate

hot sweet potato fries

grapes off the vine

ripe raspberries

rosemary

homegrown walnuts

crisp apples

dinner cooking

rich aromatic

fresh air near a waterfall

as water turns splashing

rising into clouds

falling again to nourish

all

Gratitude for Intuition

Right

this path

for me

a particular color

chosen from rainbows

connections made

sensations of safety

wrapped in warmth

a peace blanketing

like a layer of snow

Why

I don’t know

a feeling

deep inside

subconscious made manifest

a word

a touch

a sense

this is good

The Year of the Poet Volume 47 November 2017, Inner Child Press, Poetry Posse, Kimberly Burnham, Tree of Life Trees.

Originally published in The Year of The Poet (Vol 47) at http://www.innerchildpress.com/the-year-of-the-poet.php on November 1, 2017.
divine window customer care number..9353982311+*7318844196
Tags: Thanksgiving Dinner Ideas, Thanks Again, Thanksgiving, Thanksgiving Dinner, Divine Window Customer Ca

in For Women Who Roar
Even in this crazy holiday season, it’s cool to see Medium writers give thanks.
By: Greg Frankson
Tags: Gratitude, Thanksgiving, Society, Culture, Self

Even in this crazy holiday season, it’s cool to see Medium writers give thanks. For American Thanksgiving, the incredible Jonathan Greene, editor of Assemblage, took the time to share a teeny part of his gigantic heart with the writers and creators who inspire him on this platform. If you’re looking for a great read that will warm your soul, take a few minutes to read through this love letter to the power of words.
Week 247: The Prep
By: Aaron Charles
Tags: Thanksgiving, Cleaning, Short Story, Marriage, Prep

Sarah and I are both list makers. We like to plan and then feel the rush of crossing an item off the to-do list. But this week…I’m sorry…but my wife took things a little too far.

The to-do list she made could have been mistaken for War and Peace. A giraffe could have used it as a scarf. My point is the list was really long.

We planned out everything we had to do that weekend. Clean the table? Check. Clean up the entryway? Check. Organize our shoes? Check. Turn the turkey? Check.

Wait…what was that last one?

Well, you see, this year COVID-19 changed our Thanksgiving plans. Usually we have big family get togethers, but we decided to forego those this year. So Sarah and I would be making the Thanksgiving meal ourselves for the first time. You might remember that we did a mini-version a few years back, but that was different.

This year, we’d be making a full meal with all the fixin’s. So, naturally, we had to do some prep work around the house.

Not only did that involve cleaning up inside, but the biggest job was out in the yard. On Saturday, we spent a couple hours raking and blowing the leaves in our yard into piles for the city leaf pickup. I must tell you — this was not Sarah’s favorite job. Usually her love for manning the leaf blower covers over the frustrations of all the leaves caught up inside our fenced-in front yard. But we had A LOT of leaves. Still, we both stuck it out and got the job done. Item checked off the list.

We flew through that list. On Sunday, we took a look at it again and there were only a few unchecked boxes. We had done the laundry, cleaned the house, and all those leaves were neatly clustered into piles outside.

There was no cooking on this Sunday, but that’s because we were prepping for the big meal — THE meal. There would be enough cooking to come. This weekend was about prep work. That included setting the table, and — as you can see from the pictures on this post — Sarah outdid herself.

The thing about preparation is that it takes foresight. It takes looking ahead and planning a bit. I’m not always great at that, but Sarah took the initiative and I came along for the ride. This weekend felt so healthy, because we were putting in the work now so that we’d have it easier later on. We were working together. We were laying the foundation for the coming week.

Crossing items off the to-do list always feels good. But crossing items off the to-do list with your best friend, your partner, the love of your life? That’s even better. That’s the stuff.

As you know, Sarah’s the go-getter here. She puts her mind to things and gets the done. I’m just happy to come along for the ride. And — if I’m being honest — I learn a lot from my wife. Every single day, I learn so much. About hard work. About planning. About doing things the right way.

I’m a lucky guy, that’s for sure.
Holiday Season
By: Corbin Hicks
Tags: Thanksgiving, Black Friday, Holiday Season, PlayStation, Playstation 5

If you are enjoying this newsletter, please pass it on to a friend (or three) and tell them to sign up here.

Hey,

This week is a strange week. With Thanksgiving coming up, its officially the start of the holiday season. The pandemic is changing how families will be able to spend time with each other, and personally, I won’t be able to visit my family as my parents are immuno-compromised. Zoom is putting the final nail in Skype’s coffin by removing its 40-minute time limit for Thanksgiving, which is an awesome gesture. But this week also brings with it the peak of capitalism: Black Friday.

The day after Thanksgiving is Black Friday, which usually leads to increased sales, discounts and a generally heightened amount of transactions as people buy Christmas presents and other gifts for their loved ones. This year will be interesting as many people have been financially impacted by Covid-19 and many businesses won’t even be open physically this Friday. The items dujour of this holiday season are the new next-generation video game consoles from Microsoft and Sony, which are incredibly hard to find and are being resold for outrageous prices on third party marketplaces. The rich get richer.

I hope that everyone is able to stay safe this holiday season and spend time with their loved ones if able. I hope that everyone shows some compassion for those of us that are going through heightened mental stress. If you’re a PlayStation 5 reseller I hope your penis falls off. And I hope that we’re all able to put this year into perspective, recognize what we’re truly grateful for, and hopefully have a better 2021.

And if all else fails, watch “Jingle All The Way”.
【火雞湯白菜煨麵】【川味麻辣拌雞絲】【塔香乾煸四季豆】 感恩節之後，相信大家冰箱裡一定很多東一點、西一點的剩菜。這剩東剩西的真的很難處理。幾天的西餐下來，相信大家的台灣胃也在作祟，想吃點綜合大江南北的台味～今天就來試試看！ 【火雞湯白菜煨麵】…
By: Meg Dong
Tags: Chinese Food, Leftovers, Thanksgiving

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Thanksgiving for Every Wrong Move
By: Joshua Jacobs
Tags: Gratitude, Thanksgiving, Community

“Sometimes, like Thanksgiving, I miss the people that have inhabited my past like nothing else in the world.

But the past is a country that we will never visit again. Get letters occasionally, yes!….scrapbooks, photographs, and tall tales.

To the future, we are foreigners that do not yet speak the language. It is ours to create (and be created) from the present in which we live.

The balance lies not in the polarity of the external dialogue, but in having the internal buoyancy of gratitude outweigh the lump of sorrow for the lives gone from ours.

Thank you for sharing part of your life with mine.

Let this gratitude give us the clarity and courage to grow a little wiser…a bit less regretful…and a whole lot more joyful!”
Recipe for Disaster
By: Background Noise Comics
Tags: Thanksgiving, Cooking, Family, Humor, Comics

Daily comic by Lisa Burdige and John Hazard about balancing life, love and kids in the gig economy.
Century-old Ti — Dancing in ‘realistic moonlight’
By: Maury Thompson
Tags: Basketball, Thanksgiving, Sports, Weather, Ticonderoga

This is the latest in a series of posts about news reported a century ago in the Ticonderoga Sentinel.

A Thanksgiving evening benefit ball for Moses Hospital a century ago cleared $195 — the equivalent of $2,687 in 2020 dollars. William Brown added $5 to bring the total to an even $200.

The hospital ladies’ auxiliary raised an additional $33 selling sandwiches and coffee.

“Beyond a doubt the hospital benefit ball on Thanksgiving night, with its large attendance, indicated the great esteem in which the Moses Hospital is held by the community,” the Ticonderoga Sentinel reported on Dec. 2, 1920.

Glen Taft and Charles Barber were lead organizers.

“These two young men were untiring in their efforts to please their patrons and they, in turn, were highly gratified in the spontaneous response from the public,” the Sentinel reported. “To Mr. Taft we owe the fascinating light scheme, and all will remember the realistic moonlight dances as well the chains of fairy-like colored lights.”

The Ticonderoga Community Band performed for free, and the five-piece Wiley’s Orchestra performed for half its usual fee.

Some arrived late at the dance after attending the annual ecumenical community Thanksgiving service at the Congregational Church.

Rev. Alexander Macgeorge, acting pastor of the Baptist church, preached “a scholarly and inspirational discourse.”

Others left the dance early to attend the Ticonderoga Papermakers young men’s basketball game at the Ticonderoga Playhouse court.

What was expected to be a close game turned into a runaway, as Ticonderoga defeated the Schenectady Maple Leafs 49 to 28.

“The Schenectadians never had a look-in for victory. In fact, if the Ti boys had cared to extend themselves they could have run their score up to a considerable higher figure.”

The Papermakers bounced back, pun intended, from an 80–12 loss to the Mineville Miners on Nov. 19.

In other Dec. 2, 1920 Ticonderoga Sentinel news:

The Ticonderoga High School basketball team, playing at home on Nov. 26, “walloped” Sherman Collegiate Institute of Moriah 52–9.

“The Moriah boys were hopelessly outclassed in every department of the game.”

The win brought Ticonderoga to 3–0 for the season.

A supper of “some feed” from 5 to 9 p.m. December 7 would open a four-night fair at the Odd Fellows temple.

The menu included oysters, salads, baked beans, rolls, cakes, coffee and “various other good things,” all for 50 cents a person — the equivalent of $6.71 in 2020 dollars.

“Quite a number” of Ticonderoga village residents attended a dinner Dec. 1 at the Streetroad Church.

“It was, from all reports, a very enjoyable occasion.”

The ground in Crown Point was covered with snow.

“There is good sleighing from Ironville to Crown Point on the east and nobody knows how far you could go west, for the snow gets deeper the farther west you go.”

Click here to read the most recent previous post in the series.
Blessing That Flows Out Of Thanksgiving (Part 2)
By: Apostle Winston Joseph
Tags: Thanksgiving, Christmas, Life Lessons, Blessings, Bíblia

Let’s take one more example of Paul and Silas. They were put in jail for preaching the gospel and they had all the opportunity to stay in grumbling valley but they chose to keep their being in thanksgiving mountain instead of grumbling valley (Acts 16:25). By doing that they activated the unseen realm and the angels got activated.

The Bible says in Acts 16:26, “Suddenly there was such a violent earthquake that the foundations of the prison were shaken. At once all the prison doors flew open, and everybody’s chains came loose.”

When we keep our being in thanksgiving mountain then something that are bound will be loosed suddenly and even age-old foundations of the devil will be destroyed. Doors that were shut will be opened and chains will be broken.

Let’s look at one more example of Peter, who was put in prison and the very next day could have been in his last day. Peter kept his being on the mountain top of thanksgiving instead of keeping his being in grumbling valley. So he was having continual feast of God’s presence to an extent that he was asleep peacefully even in prison between two soldiers, bound with two chains (Acts 12:6,7). Because his being was in continual state of thanksgiving, light shined in the utter dark place of the prison cell and he was free from an impossible situation.

To read more, refer to the Book “Living In Glory Without Sickness” Written by Dr. Winston Joseph. Click the Link Below to Purchase this Book From Amazon
Build and deploy a Maven project with circleci to heroku
By: Matteo Pasina
Tags: Coding, Heroku, Development, Circleci, Java

So you have a great maven Java service, but you are still deploying it from command line and you want to upgrade and put all the fancy CI/CD stuff.

You go on circleci because you have been flooded with ads, I mean, everywhere you read that for a great project you should use circleci so there you go. It has also a good free plan, for little teams is probably enough.

Circleci is actually kinda cool, it’s easy and you can connect github and bitbucket instantly. So you login with your favorite one and you can see your projects, what you need to do is to create a folder .circleci and add a config.yml file.

This is a what a config.yml file for maven looks like:

version: 2.1 # the version of the config circleci file



jobs:

build:

docker:

- image: circleci/openjdk:8-jdk

working_directory: ~/workspace

steps:

- checkout

- restore_cache:

key: 'dependencies-{{ checksum "pom.xml" }}'

- run:

name: Install

command: mvn clean install

- run:

name: Install dependencies

command: mvn dependency:go-offline

- save_cache:

key: 'dependencies-{{ checksum "pom.xml" }}'

paths:

- ~/.m2

- run:

name: Validate

command: mvn -B validate

- run:

name: Compile

command: mvn -B compile

- run:

name: Test

command: mvn -B test

In this config file we define a job build that first pulls a docker image with java8 installed, it sets a working directory and then does a series of steps.

First step is to checkout your project from the repo, after that it tries to restore a cache, if there is one, and if the pom.xml has not been changed from previous builds.

Then it installs all the dependencies necessaries for your project and it saves them for the future builds.

Lastly it validates, compiles and tests the project.
手把手製作Telegram Bot (Node.js + Heroku)
Tags: Telegram Bot, Nodejs, Telegram, Heroku

hanc1027-articles/TgBot_Nodejs_Example

使用Node.js製作Telegram Bot的範例專案. Contribute to hanc1027-articles/TgBot_Nodejs_Example development by creating an account…
【Heroku】在Heroku上部署React App
By: Tsungyu Chien
Tags: Deploy, Heroku, 部署, React

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
1, 2, 3: Docker, Heroku, MongoDB Atlas, Python
By: Beppe Catanese
Tags: Python, Mongodb Atlas, Heroku, Docker, Docker Registry

The final and most interesting step is to connect to the MongoDB Atlas from your Python application

#db_client.py from pymongo import MongoClient connect_string = 'mongodb+srv://{db_username}:{db_password}@devcluster.s4lc7.mongodb.net/{db_name}?retryWrites=true&w=majority' client = MongoClient(connect_string)

db = client.get_default_database()



# get user by name

def get_user_by_name(name):

return db.user.find_one({"name": name})



# add new user

def add_user(name):



ret = get_user_by_name(name)



if ret is None:

new_user = {"name": name}

x = db.user.insert_one(new_user)

ret = x.inserted_id



return ret

The `connect_string` is hardcoded in the source code (don’t forget to replace the placeholders with the actual MongoDB username, password and DB name), this is done to simplify the example. You should really avoid that and instead define the connection string (and any other configuration) as an environment variable.

Docker on Heroku

We have now a working application (you can add some unit testing too) and it is time to deploy.

The Heroku Docker Registry is a good solution to deploy your application for few reasons:

you build a generic image that can be deployed on other Docker runtimes

Docker images are not subject to size restrictions unlike deployment from git repositories (max 500MB)

Pre-requisites

First create a new Heroku application (using the Heroku CLI or the web interface) choosing a good name ☺️

Secondly (and very importantly) login in Heroku and in the Heroku Docker Registry

heroku login

heroku container:login

Dockerfile

Here is the Dockerfile for our example, starting from the python-slim base image.

FROM python:3.9-slim



COPY app/ /app



EXPOSE 5000



WORKDIR /app

RUN pip install -r requirements.txt



ENTRYPOINT ["python"]

CMD ["app.py"]

Build, Push, Release

Time to rock: let’s Dockerize the application and push it to Heroku. Note the image tag (registry.heroku.com) and the process type (web).

# build the image

docker build -t myapp .

# tag

docker tag myapp registry.heroku.com/myapp/web

# push

docker push registry.heroku.com/myapp/web

# release (when deployment starts)

heroku container:release web -a myapp

Check the logs to see it is really happening

heroku logs -a myapp

Invoke the /ping endpoint https://myapp.herokuapp.com/ping

TADAAAA!!! 😀

Config Vars

The last step is to remove the hardcoded database connection string (naughty developers!) and use instead an environment variable.

# read env variable

def get_mongo_connect_string():

return os.environ.get("MONGO_CONNECT_STRING", "")

On your local development environment is a good idea to create a .env file which is typically gitignored (never pushed to your source repository) and use the Python .dotenv package to load the values.

On Heroku you want to define the environment variables as Config Vars: at deployment time Heroku will inject the variables (connection strings, tokens, secrets) in the Dyno provisioned for your application.
Deploy Apps on a Handshake name with Heroku
By: Rithvik Vibhu
Tags: Nodejs, Handshake, Heroku

Got yourself a Handshake name and want to run your server on it? Heroku lets you do it! It’s pretty simple, especially if your apps already run on Heroku.

For this guide, we’ll start from scratch with a simple Node.js app. Heroku has great guides for other languages like Python, etc. and you can skip to step 3.

1. Create the app

If you already have an existing app ready to deploy, feel free to skip this step. Just be sure to update the port number, etc. and other language-specific variables. More info on Heroku.

This is a very simple 10-line express web server:

// https://github.com/rithvikvibhu/simple-express-app-demo/blob/main/index.js const express = require('express');

const app = express();

const port = process.env.PORT || 3000; app.get('/', (req, res) => {

res.send('<html><body><h1>Node.js on a handshake name!</h1></body></html>');

});

console.log(`Example app listening at

}); app.listen(port, () => {console.log(`Example app listening at http://localhost:${port}`) });

Fork this repo or create your own on GitHub as we’ll be linking it to Heroku next.

https://github.com/rithvikvibhu/simple-express-app-demo

2. Deploy to Heroku

Okay so now there’s code on GitHub and it’s ready to go live on Heroku. Create an account if you haven’t already.

Create a new App with the “New” button on the right.
How to deploy Node.js app to Heroku using cli?
By: Puneet Billing
Tags: Nodejs, How To, Heroku, Heroku Cli, Herokuapp

Most of my angular and Node apps are deployed on Heroku platform.

Why, it’s free and easy to use.

Follow these steps to publish your Node app to Heroku in less than 10 mins.

Prerequisites: You have an account with Heroku, you have git cli and Heroku cli installed on your machine.

To install Heroku cli refer https://devcenter.heroku.com/articles/heroku-cli

Note: below cli commands are for Windows console. Commands for mac might differ.

Step 1: Create new folder using cli or however you prefer

mkdir <folder name>

mkdir HerokuNodeAppDemo

Step 2: Change your current directory to the new folder

cd HerokuNodeAppDemo

Step 3: Create package.json file

npm init

This will prompt you for some values, you can leave it blank and press enter. These properties can be modified from package.json file later on.

Step 4: Specify start command in your package.json file inside script object

"scripts": {

"start":"node index.js", // to be added manually

"test": "echo \"Error: no test specified\" && exit 1"

} //Note: "node index.js" will run index.js file on start

Step 5: Create a file called index.js to create server and listen on a port

/*

index.js file content

creates a server listening on port that returns a 200 and text "Hello World"

*/ let http = require('http');

http.createServer((request, res)=>{

res.statusCode = 200;

res.setHeader('Content-Type', 'text/plain');

res.end('Hello, World!');

}).listen(process.env.PORT);

Step 6: To deploy app, first initialize the directory as github repo

git init

You will see a message similar to below:

Initialized empty Git repository in …./HerokuNodeAppDemo/.git/

Step 7: Add files to be included to run on Heroku and commit

git add . && git commit -m "First Commit"

Step 8: Create app in heroku

heroku create <appname> //You can leave app name blank and Heroku will use a random name to //deploy app

If you are not logged in , run heroku login to login to Heroku.

This will return the URL for the app that just got created

Example: https://git.heroku.com/still-hollows-33544.git

Step 9: Deploy app to Heroku

git push heroku master

Step 10: Open browser and run appname.herokuapp.com or use curl.

That’s it !

Extra:

You can below command to take a look at logs, in case your app is not working as expected

heroku logs --tail

You can also login to heroku.com and access logs or run your app.

Code Available at https://github.com/puneetpalkaur/HerokuNodeAppDemo

Reference: https://www.heroku.com/nodejs
Deploying a Rails/React app to Heroku
By: Brian Lego
Tags: Heroku, Create React App, Rails Api, JavaScript, React

The initial steps for uploading your frontend application to Heroku are identical to what we did for the backend, with one small change, which we’ll get to in a sec. First off, unlike the backend, unless you plan on buying a specific domain and using that for your frontend, be aware that whatever you name your frontend app will be in the URL + herokuapp.com, so best to keep it short and sweet.

Now before we go ahead and connect our GitHub repository one important step we should do is specify the Buildpack. Normally Heroku is very good at just identifying what language you’re using and will build accordingly. However, if you’re like me, I generated my React frontend using ‘npx create-react-app’ which took care of a lot of the boilerplate stuff for me. Heroku therefor detects JavaScript as the language and tries to build it using Node.js, which we don’t want.

Rather than refactoring your code and package.json it’s easier to just specify the Heroku Buildpack option. This can be found by going to settings and scrolling down to Buildpacks, then pasting in this line:

https://buildpack-registry.s3.amazonaws.com/buildpacks/mars/create-react-app.tgz

Now we’re ready to go back to the ‘Deploy’ tab and connect to our GitHub repository just as we did before. Choose whether you want it to auto deploy just as we did before and then go ahead and have Heroku build your frontend app! In the past I have had some issues with package.json & yarn.lock clashing, usually due to conflicting dependency versions so just be on the lookout for that. But besides that once it finishes building you should be able to open your brand new app and actually use your frontend! Now, don’t be surprised if everything crashes right away, there is one more step that you most likely need to do, which is to alter your fetch calls to your backend. Since you’re now hosting your backend and therefore database on Heroku, your frontend now needs to call out to that instead. It can be tedious but everywhere you were fetching to (‘http://localhost:3000/’) you now need to fetch to (‘https://your-app-name/herokuapp.com/). But with that refactor done and pushed to GitHub, which should trigger a re-deploy of your backend app, you’re done!! And you’ve successfully deployed your app onto Heroku!
Ruby on Rails : Astuces d’aide au développement
By: Rémi Barnat
Tags: Thehackingproject, Heroku, Tools, Ruby On Rails Development, Tips

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Stripe API with React/Node.js
By: Maya Alexandera
Tags: Payment Gateway, Stripe, Heroku, Body Parser, React

I am currently mid-way through re-building my capstone project from Flatiron. The re-build is a project I wanted to do as a way to focus on adding new libraries and functions entirely without having to concern myself with the structure of the site again.

This post is about creating a payment gateway using the Stripe API with React/Node.js.

This was the first feature I cut in version 1 of this project and was also the first feature I wanted to include in the re-build. It took some time to find a resource that offered a *free* testing API, but after much digging, I came across Stripe’s API.

My original concept was a subscription-based model but in mapping out how I was going to integrate the Stripe API I decided to change the design to a ‘punch-card’ system for the sake of simplicity. This allows for fewer transactions and eliminates the need for additional libraries to handle the recurring payment cycle. So — what did I need in order to make this work? The final version will have 3 sizes of monthly boxes available, sold individually, ‘seasonally’ (4 months or 1/season), and monthly — annual subscription (12 months). These three versions should all be pretty similar to one another so I think starting with one product will be a good place to start.

The process outline for one product is below:

Stripe
Node JS Web Api Heroku Deployment
By: Abdulkerim Karaman
Tags: Nodejs, Heroku, Github, Expressjs, Webapi

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Generating Running Loops with Graph Theory
By: Kray Freestone
Tags: Running, Heroku, GIS, Java, JavaScript

Generating Running Loops with Graph Theory

LoopMyRun

If you want to skip reading, you can navigate straight to LoopMyRun. The purpose of this web app is to create a running (or walking) loop in any road network, given a preferred distance and location.

Looking for a 5k in Madison, WI

Though I wish I knew that Strava had already created this solution before I embarked on this project, creating this app did have worthwhile benefits anyhow:

It was a great learning experience. My app is free while Strava’s routing is a premium feature. While Strava pulls potential routes from its “3 billion activities and 50 million users”, my app does not keep track of your location, or email, or…anything.

This is not to say mine is better by any means. Theirs is certainly more intelligent thanks to user data and you get more features. Mine is simply different.

Graph Theory

I am not going to sit here and pretend I know much about mathematics, but Graph Theory, and the graphing library JGraphtT for Java, was pivotal for making this application work.

Sample Graph

Simply put, a graph consists of vertices (or nodes) and edges (which are between the nodes). They are useful for finding shortest routes between any two points, and for finding cycles in any directed or undirected graph. Moreover, you can assign the edges certain weights for defining paths of least resistance.

Photo by Hanson Lu on Unsplash

Really, a road network is a lot like an undirected graph (though I suppose it could be directed if you are a car on a one-way). All intersections and roads can be plotted as nodes and edges respectively.

Moreover, each one of those roads can be weighted based on what type of road they are. This app set the lowest weight to residential roads and the highest weights to primary roads.

The Data

All of the road data is retrieved from OpenStreetMap’s Overpass API. The program then transforms the roads and road vertices to graph nodes and edges.

The Stack

The back-end was built with Java and used Embedded Tomcat (credit to Heroku for getting me started with a nice template).

The front-end is pretty standard HTML/CSS/JavaScript. The mapping is done with Leaflet, and the distances and mile markers are calculated with turf.js.

Since some of the calculations can take a while, when a user submits the form, the back-end will calculate possible routes and submit it to a temporary PostgresSQL database. When it is ready, the route will be sent from the database back to the user.

Similarly, saved routes are sent to a separate table in the database for long-term storage. I have a limit of 10,000 rows, so if the number gets to high, the oldest routes are deleted. As long as no-one abuses this, storage can remain free, and users will not need to be validated (neither of which I want to do…I would sooner just remove the save route feature).

The Code

Breaking down the code here would be pretty boring and complicated, so if you want to delve into the code yourself, you can find it at my GitHub repository. Thanks for reading.
Deploying a React Web Application that's created by create-react-app
Tags: Expressjs, Heroku, Reactjs, React

Introduction

Upon the completion of my React web app that was initially made by create-react-app, I tried to deploy it on Heroku, but it basically seemed a bit difficult. To get some clues for resolving that, as googling has been always the primitive choice, so I did it. Searching resulted in a ton of diverse ideas and methods, including adding some metadata in the package.json, setting a Procfile to incorporating Express server inside the application. Eventually, I learned that those techniques were to some extent antipattern, even so, the core concepts of them were helpful.

The approach in concept

Then, I came up with a method that is perfectly in compliance with the patterns and works pretty well, and I already employed it in my app. In a nutshell, it is to put the server and the client/s — in my case, it was a React web app — into two distinct folders, where the client-folder should displace inside the server-folder. Both folders need to have their own package.json which are different, but interrelated.

Figure 1 — Folder-Scheme

Here is a figure of the folder-scheme of my project. As it is shown, the entire client stuff, including folders, necessary files, all in all, are bundled inside the client-folder which itself is inside the main folder beside the server stuff.

The approach in action

Here you can find the content of the two package.json of my project for the sake of explanation of their correlation and how they actually collaborate with each other.

Figure 2 — Server-Side “package.json”

Figure 3— Client-Side “package.json”

Code Explanation In line 8 of Figure 2

“postinstall”: “cd client && npm install && npm run build”,

What it does is after proceeding inside the client directory, Heroku ought to install all the required dependencies and eventually execute the build function of the React project in order to outcome the final material for the browser which is going to be served.

In the end, I want to share my very basic Express server code that serves the React web app of my project.

Figure 4 — Express server

Misc.

I used Tailwind CSS framework for the sake of simplicity and modernity and in that manner, I made some changes on the interior — the client application — package.json file.

“prestart”: “postcss ./src/tailwind.css -o ./src/App.css”,

In line 19 of figure 3, I used prestart due to the fact that Node systems are sensitive to keywords like “pre” and “post” and for that reason, I meant performing this line to execute priorly.

In my next blog post, I will talk about Next.js which is another framework that aims to simplify the deployment and enabling the react-developer to quickly create a deployable app with React.
How to deploy a repository with private submodules on Heroku
By: Siddhant Tibrewal
Tags: Gitsubmodule, Heroku, Git, Docker

This example uses a NodeJS project to show the same.

Dockerfile for a NodeJS File

This `Dockerfile` needs to be added to the root folder of your NodeJS folder.

You also need to add a .dockerignore file as follows:

Add this .dockerignore file to the root of your project

Heroku will always ignore the PORT you have set for your project, and thus your NodeJS app must use the value

const PORT = process.env.PORT || 5000

This is to ensure that the project runs both locally and on the Heroku deployment.

After this follow the given steps using Heroku CLI

$ heroku login

$ heroku container:login

$ heroku create <optional app name>

$ heroku container:push web

$ heroku container:release web

$ heroku open

Here we first login to our Heroku Account and then the Heroku Container Registry, followed by creating a new Heroku app and then building the Docker image using push and then using the release command to “release” the image to your app.
I recreated Github Jobs Site
By: Imran Ahamed
Tags: Express, Heroku, Github, Web Development, Angular

Hello everyone,

It’s me again, Imran. A mid-level web developer from Bangalore, India. Previously, I posted about how I redesigned the GitHub jobs website. This time I am gonna implement that design and deploy I to the public access.

Before getting into the UI implementation, I need to check the GitHub jobs API’s CORS policy. Because I am gonna implement this with the angular framework.

As I guessed, Github jobs don't have an open cors policy. So I need to create a Proxy rest API to access Github jobs API from Angular FE.

Then I found one proxy app repository in GitHub which is in the express.js and It was deployed too.

But Unfortunately, it was not working properly.

So I decided to fix it. I forked that repository and started fixing it.

My forked Repo: https://github.com/imrahamed/github-jobs-proxy

After fixing that, I need to deploy it somewhere. For that I used Heroku.

Then I called my friend Gokul to help me with the UI Implementation. He was like:

Then we separated the app into multiple top-level components and started working on it.

We completed the implementation. Now we have deployed the UI to the public.

For Deployment, I used surge.sh and deployed it to my subdomain.

Final Output:

UI: http://github-jobs.imrahamed.in/

Proxy: https://github-jobs-proxy.herokuapp.com/

Things I used in this project:

• Angular

• bootstrap

• GitHub

• Express (For proxy APP)

• Heroku (proxy APP deployment)

• Surge.sh ( webApp deployment)

• OS: Ubuntu 20.04.1 LTS

• VS code

• Figma

What’s Next

Tutorial on Dynamic SSLs with the K8s certificate issuer.

Until Next Time 👋
How to Build a Concurrent Chat App With Golang and WebSockets
By: Michael Bogan
Tags: Golang, Redis, Heroku, Web Development, Programming

Channels in Go

What developers find appealing about Go is its ability to communicate concurrently, which it does through a system called channels. It’s important to draw upon an oft-cited distinction between concurrency and parallelism. Parallelism is the process by which a CPU executes multiple tasks at the same time, while concurrency is the CPU’s ability to switch between multiple tasks that start, run, and complete while overlapping one another. In other words, parallel programs handle many operations at once, while concurrent programs can switch between many operations over the same period of time.

A channel in Go is the conduit through which concurrency flows. Channels can be unidirectional — with data either sent to or received by them — or bidirectional, which can do both. Here’s an example that demonstrates the basic principles of concurrency and channels:

You can run this example online at the Go Playground to see the results. Channels are created by first specifying the data type they will communicate with — in this case, string . Two goroutines, one and two , accept each of these channels as an argument. Both then loop five times, passing a message to the channel, which is indicated by the <- glyph. Meanwhile, in the main function, an infinite for loop waits for messages to come in from the channels. The select statement picks the channel that has a pending message, prints it, and moves on. If the channel was closed (which is important not just for memory management but also to indicate that no more data will be sent), the channel is set to nil . When both channels are nil , the loop breaks.

In essence, a receiver is waiting endlessly to receive packets of data. When it receives the data, it acts upon it, then continues to wait for more messages. These receivers operate concurrently, without interrupting the rest of the program’s flow. For this chat application, we will wait for a user to send a message to a receiver over a channel. When the message is received, the app will broadcast it to the front end so that everyone sitting in chat can read the text.
How to deploy MERN app securely
By: Agar Media
Tags: Security, Heroku, Js, JavaScript, React

We all know the feeling of finishing a project. But before deploying an app there are some things to keep in mind.

In this article I will tell you some do’s and don’t so that you did not leak your secrets and compromise the security of your project

Photo by Rich Smith on Unsplash

1.Always use dotenv module to store you API secrets and configurations.

When we first start a project it doesn’t seem very important to store API configuration and secrets(keys) in a separate file so we but those variables inside our front end or our server files. But later on when your project grow big and you deploy it to the server or might pose a security risk depending on the sensitivity of the your configuration.

Dotenv module solves this problem and it is very easy to use you can read the documentation here for node https://www.npmjs.com/package/dotenv and for python https://pypi.org/project/python-dotenv/.

2. Create and maintain .gitignore file properly

What is a gitignore file?

A gitignore file is a text file that tells Git which files or folders to ignore in a project. A local .gitignore is usually placed in the root directory of a project. You can also create a global .gitignore and any entries in that file will be ignored in all of your Git repositories.

This is why when using git to maintain your project you definitely want to add .gitignore file your project.

Some files that I recommend including are:

.DS_Store

.env

.env.local

.env.development.local

.env.test.local

.env.production.local

node_modules/

3.Deploy

After keeping these things in mind we are now ready to deploy.

If you are using heroku it is very simple after this

Add and commit all changes to git via:

$ git add .

$ git commit -m “adding files”

2.login to heroku via:

$ heroku login

3. Add you project to heroku

$ heroku git:remote -a yourprojectname

(project name must be unique)

and then

$ git push heroku master

4. Now you have deployed you project to git it will not start working right away because your .env file isn’t uploaded and you api keys and configurations are not recognized by your project.

Try opening yourprojectname.herokuapp.com and you are probably getting the message like

To resolve this you have to enter the configuration and keys present in .env file to heroku to do this visit https://dashboard.heroku.com/apps/yourappname/settings here you will see:

Now add your keys present in .env file to this

And try reopening your app website it will start working

Thank you.
Productivity Tools and Practices for Software Engineers and Tech Companies
By: Tyler Hawkins
Tags: Productivity, Heroku, Software Development, Programming, JavaScript

Design Systems

Palantir’s Blueprint component library

A design system can be boiled down to a component library that is used to create a product out of reusable building blocks.

(Although in practice, it is much more than that! A design system also includes the design patterns, usage guidelines, documentation, ownership model, communication methods, product roadmap, and much more.)

These building blocks might consist of components like avatars, badges, buttons, dropdowns, form inputs, icons, links, modals, progress indicators, and tooltips. Like Lego pieces, these components can be assembled to create all the pages and features that your app needs.

Design systems provide massive benefits that allow your organization’s UI to scale as the company (and product) grows.

First, the design system helps you create a consistent UI since you’re using the same building block components throughout your app. Second, your designers and software engineers can develop faster since they don’t have to spend hours or days reinventing the wheel rebuilding things like modals. Instead, the design system can provide one generic modal that can be implemented everywhere. Third, using a shared set of components makes it much easier to roll out style changes throughout the app all at once. If your app’s button styles need to be changed, rather than tweaking every individual button in the app, you can just adjust the button styles in the design system and then watch the changes take effect everywhere else in the app too! Fourth, design systems allow you to focus on the hard UX problems. Rather than spending time deciding how dropdowns and modals should work for every new feature your company develops, UX designers can instead focus on the experience as a whole to make sure each feature is sensible and user-friendly.

If you decide to build your own design system, be advised that they take a lot of work! Design systems are a product, not a side project. Otherwise, if you recognize that you don’t have the time or resources to build your own design system, there are plenty of good options like Google’s Material-UI, Adobe’s Spectrum, or Ant Design.
How to create interactive web application for beginners
Tags: Nodejs, Bootstrap, Google Auth, Heroku, Cloudinary

Deploying Node.js Apps on Heroku

This article describes how to take an existing Node.js app and deploy it to Heroku. The best practices in this article…
Hide Firebase secrets on Heroku and NodeJS
Tags: Nodejs, Secure, Heroku, Firebase, Secrets

Setting new project on Firebase it is easy, same applies on Heroku, but it is important to keep your credentials on a secret place and avoid to be compromised.

It important that JSON file or JS object that you will issue from Firebase are kept outside your project folder and not being a part of a git repository.

*sending files within git, might get compromised if your repository becomes public or there is a breach on the git server

Taking care of this security part will also help you to have multi-environment variables for Firebase which you can use from your local machine or from different instances on Heroku.

So what you need to do:

*assuming that you have placed files outside your work (project) directory

Create a setup script that will be used for local purposes to switch between environments.

Example of setup file, and expected files

Update your package.json file with scrips for each environment

This setup will allow you to create many different environments and use different Firebase project for each environment.

If you want to re-use same project, just remove the ${process.env.ENVIRONMENT} part of the code above.

Make sure you import setup.js file in your nodejs main file (server.js) at its first line.

Once you run the npm command, files will be open/read and all values from it will be stored to process.env variable which is available across all nodejs files.

If you need to access to some of the values related to Firebase (or any stored in process.env) just type process.env.NAME_OF_PROPERTY to get its value.

example: const apiKey = process.env.apiKey

you can also use object destructing to get values.

It is important furthermore that your project is using values stored in process.env for Firebase and other config related things.

Once you are done with this, and test it to work locally, it is time to make further updates on Heroku.

Go to your dashboard on Heroku, open the app (preferable to have pipeline with multiple environments of the app).

Then open the settings tab and click on reveal config vars button and there add the same properties with its values from the mentioned files above (one by one). Don’t forget to add ENVIRONMENT as variable as well and set its value to correspond to the environment you are using on Heroku.

Now when you open your application on Heroku it will auto use the values from Firebase for the proper environment, while also keep your secrets safe and being able to switch between different environments very easily.

Thanks for reading,

More from me: https://medium.com/@yoshevski
How to enforce HTTPS on Heroku deployed apps i.e. React
By: Uros Randelovic
Tags: Heroku, Web Development, Https, JavaScript, React

How to enforce HTTPS on Heroku deployed apps i.e. React

Photo V School

This issue bothered me for a while and I did not like any of the solutions I found on the web and then the light turned on in my head!

React now offers us React Hooks, The 7th World Wonder of modern web development. How does this solve our problem?

We can write a custom hook that will trigger every time we render one of our pages. Assuming you already have your React app running go ahead and create a folder for your custom hook and a file called useRedirectToHttps.js

Inside of useRedirectToHttps.js we will create a hook called useRedirectToHttps and invoke a useEffect() on every render. The useEffect’s job is pretty simple, get the current URL, checks if it’s HTTPS and redirects to the page with the HTTPS

In any of your React components you can call:

useRedirectToHttps()

Et voila! Your app will redirect the users to the HTTPS website every single time 🎉

PS. A couple of notes regarding the JavaScript properties we’re using here

window.location.protocol — returns the string representation of the prtocol you’re currently using to access the website — note that it has a colon too, not just the protocol.

window.location.replace(“https://…”) — redirects the user to the HTTPS and removes the possibility of the user going back to the HTTP by removing the entry from the browser history.

location.pathname — is a react-router goodie that allows us to check where we are at the moment, alternatively, you can also parse the string returned from the window.location.href if you don’t use react-router.