When I was going through a trial in life some time ago some friends sent me a card, which I found very comforting and helpful.
It contains a poem entitled "The Plan of the Master Weaver." You've probably come across the analogy that our life is like a beautiful tapestry that God is weaving with both light and dark coloured threads, picturing joyful and sorrowful times.
Many of us have seen tapestries adorning the walls of ancient castles or churches. Usually they depict battle or country scenes. Tapestries have been woven for hundreds of years in many diverse cultures. Important structures and buildings of the Greek Empire, including the Parthenon, had walls covered by them. In the 13th and 14th centuries the Church recognised the value of tapestries in illustrating Bible stories to its illiterate congregations.
The celebrated Bayeux Tapestry is made up of a series of scenes from the life of Harold and of the invasion and conquest of England by William the Conqueror. This embroidery is about 70 metres (or 230 feet) long. It contains 1522 motifs and inscriptions in Latin, worked in red, green, blue and yellow wool, on a white canvas foundation, and is still in good condition.
The top side of a weaving or tapestry looks better than the bottom. We are generally in a position of only being able to see the knotted ends and frayed edges of what God is doing in our lives. We see the bottom of the tapestry, which looks like a haphazard jumbled mess.
But if we could view the other side of the picture we would see that God is doing something beautiful. We are on the underside, going through painful circumstances, but not always knowing God's purposes for them.
That's what the poem points out. Another similar and famous poem was written by Benjamin Malachi Franklin, but was popularised by Corrie Ten Boom in her famous book "The Hiding Place". See footnotes 
The first part of the poem starts like this:
“My life is but a weaving between my Lord and me I do not choose the colours He worketh steadily”
It is a partnership between God and us. Our thoughts, imaginations, motives, actions, attitudes etc are all threads and each moment of time is like the shuttle that weaves those threads into the tapestry of our life.
God is involved too, as the master weaver behind it all, weaving various situations and circumstances through our lives.
There are a couple of scriptures that refer to life being like a weaving.
Isaiah 38:12 Like a shepherd’s tent my house has been pulled down and taken from me. Like a weaver I have rolled up my life, and he has cut me off from the loom; day and night you made an end of me.
The context is King Hezekiah talking about his death. He describes his life as being rolled up like a weaver rolls up a tapestry carpet.
Job 7:6 My days are swifter than a weaver’s shuttle, and they come to an end without hope.
A similar context, where Job is speaking of his impending death when suffering his great trials.
Here's a more positive verse on the way God is weaving our lives in a pattern:
11 For I know the plans I have for you,” declares the Lord, “plans to prosper you and not to harm you, plans to give you hope and a future.12 Then you will call on me and come and pray to me, and I will listen to you.
The context here is that God was speaking to the exiles in Babylon who had lost everything and were now slaves. No matter how difficult their life was now, God was going to rescue them - they did have a future and a hope. And so do we, even when we go through trials. They are part of God's plan for our lives. As a tapestry maker, He has a pattern to work to.
Joseph's life was a fantastic example of that. The brothers sold him into slavery, he was thrown into prison for something he didn't do -- there were lots of hard times and dark threads in the tapestry of his life, but then he was raised to prominence in Egypt and the gold threads came to the fore.
It is all summed up in Genesis 50:19-20
19 But Joseph said to them, “Don’t be afraid. Am I in the place of God? 20 You intended to harm me, but God intended it for good to accomplish what is now being done, the saving of many lives.
The next part of the poem reads:
Oft times He weaveth sorrow and I in foolish pride Forget He sees the upper and I the underside.
The wording on the greeting card my friends sent me is quite different, and even better in some ways. Mr Hallmark has expanded the wording:
"The Plan of the Master Weaver"
Our lives are but fine weavings That God and we prepare, Each life becomes a fabric planned And fashioned in His care. We may not always see just how The weavings intertwine But we must trust the Master’s hand And follow His design. For He can view the pattern Upon the upper side, While we must look from underneath And trust in Him to guide…
Sometimes a strand of sorrow Is added to His plan, And though it’s difficult for us, We still must understand That it’s He who fills the shuttle, It’s He who knows what’s best, So we must weave in patience And leave to Him the rest…
Sometimes we wonder why God doesn't answer our prayers, when we pray for long periods of time, seemingly with 'no answer'. One amazing thing to remember is that the Father didn't even answer Jesus when he prayed to have the cup lifted out of His hands. Well, God answered, but the answer was "No". It wasn't the answer Jesus physically wanted. He didn't want to go through that trial of death, but He had to. There were quite a few dark threads woven into the tapestry of His life. The flight into Egypt to survive soon after His birth, people mocking and scoffing and calling Him illegitimate etc.
Then of course there are the multitude of examples in Hebrews 11. The people went through terrible traumas and tragic times. They only really saw the underside of the tapestry but God gave them a glimpse of the beautiful upper side, and that's what they depended on. They had faith that the other side of the tapestry was worth dying for. They had faith to trust that the Master Weaver knew what He was doing.
One thing I was reading about weaving says "In some weaving traditions, the weaver begins with a pattern, a plan, but the work is complex and mistakes are inevitable. Things do not always go according to the pattern. The master weaver is one who can incorporate the 'mistake' into a new, unique masterpiece."
So God can blend our ignorant human mistakes into a new masterpiece in our lives.
For we are God’s handiwork, created in Christ Jesus to do good works, which God prepared in advance for us to do.
The word "handiwork" (NIV) is also translated "masterpiece", "workmanship", "work of art". The word is literally "poem", from the Greek word "poiema.”
Looking at the last verse of the poem:
Until the loom is silent and shuttles cease to fly, Will God roll back the canvas and explain the reason why. The dark threads are as needful in the skilful Weaver's Hand As the threads of gold and silver in the pattern He has planned.
So we don't always understand the reasons for our trials and problems at this time, but hopefully this analogy is of help as we come to grips with them. We can only see the underside, but eventually we'll see the full picture and marvel at the wonderful masterpiece God has made of the tapestry of our lives!
I'd like to conclude with a video of actress (and author) Evelyn Hinds playing Corrie reciting the poem in her younger days.
 Cornelia "Corrie" ten Boom (b. Amsterdam, April 15, 1892; d. Orange, California, April 15, 1983) was a Dutch Christian Holocaust survivor who helped many Jews escape the Nazis during World War II. In 1970, Ten Boom co-wrote her autobiography, The Hiding Place, released in 1971 and which was made into a film of the same name two years later starring Jeannette Clift as Corrie. (Wikipedia)
 Corrie ten Boom cited the author of the poem as being unknown. In 1950 the poem was published in a newspaper, The Memphis Commercial Appeal. It was written by a man named Benjamin Malachi Franklin in the late 1940's. He was born in 1882 and died in 1965. Evidence of his authorship was submitted to the satisfaction of the U.S. Library of Congress and a copyright certificate was issued to his grandson.