Thor CLI KJV Bible Search Engine – part 4

Luis asked me for some verses (1-12) out of the book of John in chapter 9. I had not tried to use the tool to grab a sequence of verses before. With some quick thinking I realized I could easily grab a range of verses in groups of ten starting from the first verse:
$thor bbl:ref john 009:0[01][0-9]
john 009:001 And as Jesus passed by, he saw a man which was blind from his birth.
john 009:002 And his disciples asked him, saying, Master, who did sin, this man, or his parents, that he was born blind?
john 009:003 Jesus answered, Neither hath this man sinned, nor his parents: but that the works of God should be made manifest in him.
john 009:004 I must work the works of him that sent me, while it is day: the night cometh, when no man can work.
john 009:005 As long as I am in the world, I am the light of the world.
john 009:006 When he had thus spoken, he spat on the ground, and made clay of the spittle, and he anointed the eyes of the blind man with the clay,
john 009:007 And said unto him, Go, wash in the pool of Siloam, (which is by interpretation, Sent.) He went his way therefore, and washed, and came seeing.
john 009:008 The neighbours therefore, and they which before had seen him that he was blind, said, Is not this he that sat and begged?
john 009:009 Some said, This is he: others said, He is like him: but he said, I am he.
john 009:010 Therefore said they unto him, How were thine eyes opened?
john 009:011 He answered and said, A man that is called Jesus made clay, and anointed mine eyes, and said unto me, Go to the pool of Siloam, and wash: and I went and washed, and I received sight.
john 009:012 Then said they unto him, Where is he? He said, I know not.
john 009:013 They brought to the Pharisees him that aforetime was blind.
john 009:014 And it was the sabbath day when Jesus made the clay, and opened his eyes.
john 009:015 Then again the Pharisees also asked him how he had received his sight. He said unto them, He put clay upon mine eyes, and I washed, and do see.
john 009:016 Therefore said some of the Pharisees, This man is not of God, because he keepeth not the sabbath day. Others said, How can a man that is a sinner do such miracles? And there was a division among them.
john 009:017 They say unto the blind man again, What sayest thou of him, that he hath opened thine eyes? He said, He is a prophet.
john 009:018 But the Jews did not believe concerning him, that he had been blind, and received his sight, until they called the parents of him that had received his sight.
john 009:019 And they asked them, saying, Is this your son, who ye say was born blind? how then doth he now see?

Later I’ll add a better range method.

Now, about grabbing chapters- Retrieving the full chapter is much easier after adding a new Thor task:

desc "ch [bookname, chapter]", "display a particular chapter"
def ch(bookname="genesis", chapter="001")
inside(Bbl.source_root) {
cmdline = grab_search_results
output = `#{cmdline}`
shell.say pretty(output, /[0-9]+:[0-9]+/, false)

Let us grab psalms 112:

[code]$ thor bbl:ch psalms 112
psalms 112:001 Praise ye the LORD. Blessed is the man that feareth the LORD, that delighteth greatly in his commandments.
psalms 112:002 His seed shall be mighty upon earth: the generation of the upright shall be blessed.
psalms 112:003 Wealth and riches shall be in his house: and his righteousness endureth for ever.
psalms 112:004 Unto the upright there ariseth light in the darkness: he is gracious, and full of compassion, and righteous.
psalms 112:005 A good man sheweth favour, and lendeth: he will guide his affairs with discretion.
psalms 112:006 Surely he shall not be moved for ever: the righteous shall be in everlasting remembrance.
psalms 112:007 He shall not be afraid of evil tidings: his heart is fixed, trusting in the LORD.
psalms 112:008 His heart is established, he shall not be afraid, until he see his desire upon his enemies.
psalms 112:009 He hath dispersed, he hath given to the poor; his righteousness endureth for ever; his horn shall be exalted with honour.
psalms 112:010 The wicked shall see it, and be grieved; he shall gnash with his teeth, and melt away: the desire of the wicked shall perish.

Advantages for WordPress Development with Git

Lately I decided to play with git and WordPress development.
I modified this gist which is the .gitignore for a regular wordpress project.
This is my version:
# Ignore everything in the root except the "wp-content" directory.

# Ignore everything in the "wp-content" directory, except the "plugins"
# and "themes" directories.

# Ignore everything in the "plugins" directory, except the plugins you
# specify (see the commented-out examples for hints on how to do this.)
# !wp-content/plugins/my-directory-plugin/

# Ignore everything in the "themes" directory, except the themes you
# specify (see the commented-out example for a hint on how to do this.)

# Ignore everything in the "uploads" directory, except the wpsc directory
# within the uploads only listen to upgrades and themes
# however within themes folder just listen to hmmujer

The main advantage I rapidly became aware of was that I could implement new features and if I messed up then I could come back to a point where I was absolutely confident on my code. Since it could be a live site, then I can rapidly switch between the current branch and the feature branch to watch how the changes look.

Of course I develop on a local server first, so that is good so I can test results on the browser immediately and branch other features as well.


1. I added two lines of code on the products_page.php for handmademujer site:

2. I come back to master branch git checkout master, refresh browser and get my site back:

Future Problems (Questions for Phil):
– how to work with upgrades on plugins? and how to do the merge with the latest version with my changes to it? Notice that if I have not updated my plugin for a while it could be like 1552 lines to update. How to manage that complexity with git?

– what to do in case the state of the database needs to be also restored, does git work or have some functionality for keeping also the state of the databases? what could the alternative be?

I feel more secure now to explore other features and isolate independent advances that I can later on merge to make up a better site. We created a better .gitignore file that we can further tailor to work with wordpress, ecommerce or other important plugins that tend to change with time.

You can show appreciation by donating:
By donating you will be helping me to help others as yourself.

Thor CLI KJV Bible Search Engine – part 3

In part 1 I created a simple CLI (command line interface) Bible Search Engine. I then built a Thor version. It’s cool. It works. But I can’t lookup verses very easily. So, I want to remedy this situation. I just add a new Thor method to my bbl Thor task:

desc "ref [bookname,verseref]", "display a particular verse"
#method_options :sort => :boolean
def ref(bookname="genesis", verseref="001:001")
inside(Bbl.source_root) {
output = search_for_phrase
shell.say pretty(output, verseref, false)

Now I get the following:

$ thor bbl:ref john 003:013

john 003:013 And no man hath ascended up to heaven, but he that came down from heaven, even the Son of man which is in heaven.
john_1 003:013 Marvel not, my brethren, if the world hate you.
Now, it occurred to me that we could play around with some numerals. Before proceeding, I must say I’m not one of those “Bible code” guys. I am, however, a big fan of Don Knuth, author of Things a Computer Scientist Rarely Talks About and 3:16. In 3:16, Don surveys the sixteenth verse of the third chapter of every book in the Bible with a third chapter. Who said the Bible was boring anyway?

So, with our Thor tool it turns out we can pull the long list of 3:16 verses very easily:
[code]$ thor bbl:ref . 003:016[/code]

acts 003:016 And his name through faith in his name hath made this man strong, whom ye see and know: yea, the faith which is by him hath given him this perfect soundness in the presence of you all.
chronicles_1 003:016 And the sons of Jehoiakim: Jeconiah his son, Zedekiah his son.
chronicles_2 003:016 And he made chains, as in the oracle, and put them on the heads of the pillars; and made an hundred pomegranates, and put them on the chains.
colossians 003:016 Let the word of Christ dwell in you richly in all wisdom; teaching and admonishing one another in psalms and hymns and spiritual songs, singing with grace in your hearts to the Lord.
corinthians_1 003:016 Know ye not that ye are the temple of God, and that the Spirit of God dwelleth in you?
corinthians_2 003:016 Nevertheless when it shall turn to the Lord, the vail shall be taken away.
daniel 003:016 Shadrach, Meshach, and Abednego, answered and said to the king, O Nebuchadnezzar, we are not careful to answer thee in this matter.
deuteronomy 003:016 And unto the Reubenites and unto the Gadites I gave from Gilead even unto the river Arnon half the valley, and the border even unto the river Jabbok, which is the border of the children of Ammon;
ecclesiastes 003:016 And moreover I saw under the sun the place of judgment, that wickedness was there; and the place of righteousness, that iniquity was there.
ephesians 003:016 That he would grant you, according to the riches of his glory, to be strengthened with might by his Spirit in the inner man;
exodus 003:016 Go, and gather the elders of Israel together, and say unto them, The LORD God of your fathers, the God of Abraham, of Isaac, and of Jacob, appeared unto me, saying, I have surely visited you, and seen that which is done to you in Egypt:
ezekiel 003:016 And it came to pass at the end of seven days, that the word of the LORD came unto me, saying,
galations 003:016 Now to Abraham and his seed were the promises made. He saith not, And to seeds, as of many; but as of one, And to thy seed, which is Christ.
genesis 003:016 Unto the woman he said, I will greatly multiply thy sorrow and thy conception; in sorrow thou shalt bring forth children; and thy desire shall be to thy husband, and he shall rule over thee.
habakkuk 003:016 When I heard, my belly trembled; my lips quivered at the voice: rottenness entered into my bones, and I trembled in myself, that I might rest in the day of trouble: when he cometh up unto the people, he will invade them with his troops.
hebrews 003:016 For some, when they had heard, did provoke: howbeit not all that came out of Egypt by Moses.

Crazy. In the next installment I’ll figure out a way to filter by groups of books such as Torah, NT, OT, Pauline, etc.