Coding: Random Writing Prompt Generator

I’ve been working on this project for the last three days. I admit, the first day was spent looking for a good theme/idea and the last two was dreading to start the Javascript portion. I was really happy how it all came together, I can spend more time fixing the font sizes and playing around with it, but I think it’s time to move on to my next project. I appreciate any feedback!

Creative Writing Prompt Generator

  • A random quote generator that spits out a new creative writing prompt every time you click on ‘next’
  • When ‘write on!’ is clicked, the current prompt can be shared via twitter in a new window.
  • The back end is connected to Google Sheets.
  • Prompts are from SF Grotto’s 642 Things to Write About
  • I wanted the theme to be minimalist, exuding those millennial vibes that I love to hate. That means, peachy pink gradients, Roboto fonts, and contrasting bold blue blocks

Randon Writing Prompt Generator

Concepts I learned and problems I overcame during this project:

HTML: Open Links in a New Window or Tab by using adding a target=”_blank” attribute to your links (anchor tags). It’s worth noting that this method primarily works in desktop browsers. target=”new” can be used on mobile browsers.

Use a Google Spreadsheet as your JSON backend. I didn’t exactly use an API for this project because I had a specific idea of what I wanted the prompts to be (creative writing prompts for 642 Things to Write About). I used Google Sheets to create a list that would be pulled and linked  to my JSON backend. Doing so, I can add and quickly edit the growing list of creative writing prompts. First publish the sheet and obtain the Key from the URL and pasting it on ‘Put Key Here’. CoderWall had a great resource, I didn’t need to obtain the API from Google. (I have yet to experiment with API, yikes!)

For my own development, I broke down the pure JSON data into objects, until I found the column and item I wanted from the array.

$.getJSON("http://cors.io/spreadsheets.google.com/feeds/list/PUT-KEY-HERE/od6/public/values?alt=json", function(data) {
  //first row "title" column
  console.log(data.feed.entry[0]['gsx$title']['$t']);
});

Add JQuery script in Codepen’s JS Settings. At first I was wondering why my Jquery code was not working, and then I learned how to ‘quick-add’ JQuery in the settings, no need to write a single line of code. However, codepen, will still allow us to just SCRIPT up resources, as well. (That means, adding the resources to the HTML in the head section.) Super helpful, here’s additional resources on Adding External Resources on CodePen.

<link rel="stylesheet" href="http://website.com/style.css">
http://website.com/script.js

Twitter’s Dev Documentation on the Tweet Button.  Twitter has an amazing documentation on adding the Tweet Button. While I started using the Tweet Button on my project, I ended up just breaking it down to opt for a simpler anchor to be able to parse the links in text and add to the minimalist feel.

Dynamically change Tweet Button “data-text” attribute. This can only be done once, as discussed here, where changing the data-text attribute can be done before loading the script.

<a href="http://twitter.com/share"
 class="twitter-share-button"
 data-text="This is what we want to change dynamically"
 data-count="none" data-via="chris_camps">Tweet</a>

<script> 
$(document).ready(function(){
    $('a[data-text]').each(function(){
      $(this).attr('data-text', "This works!");
    });
    $.getScript('http://platform.twitter.com/widgets.js');
});

Getting a random number between two values

function getRandomArbitrary(min, max) {   
return Math.random() * (max - min) + min; 
}

Additional Resources:

See the Pen freeCodeCamp: Random Writing Prompts by Angel Certeza (@acertz) on CodePen.

 

Advertisements

Reading: “The Last American Man” by Elisabeth Gilbert

“By the time Eustace Conway was seven years old, he could throw a knife accurately enough to nail a chipmunk to a tree. By the time he was ten, he could hit a running squirrel at fifty feet with a bow and arrow. When he turned twelve, he went out into the woods, alone and empty-handed, built himself a shelter, and survived off the land for a week. When he turned seventeen, he moved out of his family’s home altogether and headed into the mountains, where he lived in a teepee of his own design, made fire by rubbing two sticks together, bathed in icy streams, and dressed in the skins of the animals he had hunted and eaten. This move occurred in 1977, by the way. Which was the same year the film Star Wars was released.”

I was already wowed by how well-crafted Elisabeth Gilbert characterized the last american pioneer. But it took me 150+ pages in to realize that it was a true story. I became more emotionally invested in Eustace Conway and the philosophy he lives in. At times, I sense the tragedy and losing battles he has fought so hard to accomplish.

The Last American Man follows a modern day Davy Crockett survivalist, pioneer named Eustace Conway who lived the ways of Native American Indians to start his own life in the Appalachian Mountains. He is deeply attached to the environment, survival tactics and the original way of doing things. He believes that his true calling is to reintroduce Americans to the concept of revelatory communion with the frontier, seeing himself as the “Man of Destiny”.

“I am the teacher of all people,” he says and presents himself as an “epic masculine hero” His actions aims to reverse and undo the inherent corruption and greed and malaise of modern America. Our “constant striving for convenience, [is] eradicating the raucous and edifying beauty of our true environment and replacing that beauty…” Towards the end, Eustace failed to have a sensibility about the roles people play in the world and took things too seriously. He became too closed off in his own world of his mighty dogma. In moments of grief, he always searches for logic and for answers. He may have accomplished multiple transcontinental journeys and accomplishments but failed to cultivate genuine relationships.

Apart from the characterization of Eustace, it is also a commentary on the fragile state of male identity and America. America is one of the few places in the world that celebrates old tales of the self-sufficient single male pioneers like Daniel Boone and Lewis and Clark, conquering lands and disregarding females. It serves as a reminder of the things we have forgotten and fought for that lead us to where we are now. The author poignantly ends in the epilogue:

“The history of Eustace Conway is the history of man’s progress on the North American continent. First, he slept on the ground and wore furs. He made fire with sticks and ate what he could hunt and gather. When he was hungry, he threw stones at birds and blew darts at rabbits and dug up roots from the ground, and so he survived. He wove baskets from the trees in his domain. he was a nomad; he moved on foot. Then he moved into a teepee and became a more sophisticated trapper of animals. He made fire with flint and steel. When he mastered that, he used matches. He began to wear wool. He moved out of the teepee and into a simple wooden structure. He became a farmer, clearing the land and cultivating a garden. He acquired livestock. He cut paths into the woods, which became trails and then roads. He improved the roads with bridges. He wore denim.

He was first an Indian, then an explorer, than a pioneer. He built himself a cabin and became a true settler. As a man of utopian vision, he now sustains himself with the hope that like-minded people will buy property around Turtle Island and raise their families as he will someday raise his … He evolves before our eyes. He improves and expands and improves and expands because he is so clever and so resourceful that he cannot help himself. He is not compelled to rest in the enjoyment of what he already knows how to do; he must keep moving on. He is unstoppable. And we are also unstoppable. We on this continent have always been unstoppable. We all progress, as de Tocqueville observed, ‘like a deluge of men, rising unabatedly, and driven daily onward by the hand of God.’ We exhaust ourselves and everyone else. And we exhaust our resources — both natural and interior — and Eustace is only the clearest representation of our urgency.”

Other ideas:

We seem to have stopped paying attention.

It seems that we have fallen out of step with our natural cycles of the seasons that, for millennials prior, have defined our existence. “Having lost that vital connection with nature, the nation is in danger of losing its humanity.”

If we don’t cultivate our own food supply anymore, do we need to pay attention to the idea of, say, seasons? Is there any difference between winter and summer if we can eat strawberries everyday?

How can a man operate in a society when there is no longer a clear path for him?

“What happens to young people in a society that has lost all trace of ritual? Because adolescence is a transitional period, it is an inherently perilous journey.But culture and ritual are supposed to protect us through the transitions of life, holding us in safety during danger and answering confusing questions about identity and change, in order to keep us from getting separated from the community during our hardest personal journeys.” “How is a modern American boy supposed to know when he has reached manhood? When he gets his driver’s license ? When he smokes pot for the first time? When he experiences unprotected sex with a young girl who herself has no idea she’s a woman or not?”

Problem solving because that’s the only thing we can do.

It’s a rare skill that we have to accomplish, being able to “improvise in the face of disaster”. Playing video games, for instance, Oregon Trail and being detached from the danger through a virtual screen allows us to take a step back once we fail and reach “game over”. We stand up from our desks, grab a beer and move out to our next task. On the contrary, Conway does endure all manners of hardship and does figure out how to rig something up when the axle snaps. He chooses to live in discomfort and he does, because he has to. People say “I want to do what you’re doing” in fact they probably don’t. We pride ourselves in the ease and convenience of our modern lives and when given the opportunity, we are not ready to walk away from it all. We could do it if we had to… but we won’t.

 

 

Scratch the Surface: Set up Local Environment

Alright, well this morning was off to a slow start. While the world anticipated Labor Day Weekend and getting the last modicum of work done, I read a chapter from a novel by Elizabeth Gilbert while drinking a hot cup of coffee and spent hours improving my chess notation. It was unproductive, alright.

After wrestling with the paralysis of being able to do anything and everything, I decided on a simple goal: make a WordPress site from scratch!

So far, I’ve only learned HTML, CSS and Javascript and stayed in the realm of the front-end and the comforts of the browser. I kept finding myself in situations and projects where I simply did not have any idea of what to do, where to start or what it entails. It was only evident that I develop a working knowledge of server environments and the back-end. Eventually, i’ll walk the walk and talk the talk as a web-developer.

How to get started: Set up local server environment on the computer

  • Set up a local “LAMP Stack” style environment – http://localhost:8080
    • LAMP stands for Linux, Apache, MySQL, PHP(/Python/Perl). It’s an open source bundle of software applications that creates a dynamic web server environment. There is also MAMP and WAMP, for Mac and Windows, respectively.
    • Whether you have a PC or a Mac, just download MAMP and install it on your computer.
  • I had a hiccup opening port 80 for Apache, administering as occupied, and found a simple solution on Stack Overflow:
    • Run MAMP
    • Click Preferences
    • On Preference window click Ports
    • While on Ports change Apache & Nginx Port to 8080.
      click ok
    • Start Servers.
  • Along the way, I learned that Port 8080 is a place to host a secondary or alternate web server. It is commonly used for proxy and caching.
    • The computer has 65535 potential ports to use over the internet.
    • Your web browser works on port 80. Port 8080 is typically used for a personally hosted web server, when the ISP restricts this type of usage for non-commercial customers. If you were going to host your own website from your computer, you would prefer to be able to do so on port 80, since this would mean that anyone connecting to your computer wouldn’t have to add a port number to the end of the WWW address you paid for. They could just connect to it, or to your specific IP address, and they’d have the website visible in their browser, while being served from your desktop or laptop.
    • Some ISPs want to avoid people paying for a cheaper home connection, but using it for commercial webservice. So, they restrict access on port 80. To get around this, you can use whatever port you like. You could use port 12345 if you wanted to. Port 8080 is the just the default second choice for a webserver.
  • Test PHP
    • I saved my html file to a php and opened it on the local server.
    • To test PHP, we can insert the pho tag anywhere into html. Anything that goes inside the opening tag of <?php and the closing tag of ?> work it’s magic on your server and return HTML.
      <p>Hello, world! The year is <?php echo date('Y'); ?>.</p>

      The code <?php echo date(‘Y’); ?> uses a date function to find the year. The HTML interpreted is just “2017”.

Yay, I  now have a local server and run all the PHP code I want!!!

 

Setting Up Virtual Hosts

Next Step: Setting Up Virtual Hosts

I’ve successfully added a virtual host: from allowing virtual hosts on apache, allowing SymLink Override and to adding a virtual host path. But I got absurdly stuck on removing the :8080 from the end of the URL.

The problem can be reframed from my inability to open up port :80 for Apache. Since I’m not focusing on working on multiple websites yet, which the Virtual Hosts allows me to do, I decided to move on and focusing on my local host. I was comforted by the fact that there was an absurd amount of people who were facing the same problem as I. Unfortunately, I didn’t find any solutions after disabling countless Services and Programs and playing with the configuration files. If you guys have any fail proof ideas on how to open up port 80 for Apache, let me know!

Now that I’ve set up the local server environment and I can pretend like I know that back-end like the back of my hand, it’s time to move on to the main event, WordPress. Stay tuned, self! Can’t wait to see what I come up with.

Reading: “Let My People Go Surfing” by Yvon Chouinard

Here’s another library book that has been dog-eared, annotated and watermarked so much, I really should just start buying books again. Well, maybe once I’m running back on an income.

Yvon Chouinard serves as an example of someone who truly lives and breathes the philosophies and lessons he has learned throughout the years. Pledging to only create high-quality multifunctional products, “Let My People Go Surfing” is a versatile bible: it’s his autobiography, Patagonia’s success story and a blueprint for hope all in one.

Less is more  

During my current job searching phase, this book has served as a great reminder that good companies that support causes amazing causes do exist and is something we, as individuals and organizations, should all strive for. Despite his utmost hatred for capitalism, Chouinard dismantles all complacent notions of traditional business for restraint, quality and simplicity. From his feeble attempts at living a simple life, he has learned that living a simple life does not mean an impoverished one, but one richer in all the ways that really matter.

Leaders don’t manage, they embrace change

Chouinard breaks down Patagonia’s philosophies in each of its department. Most notably, in management philosophy, he uses an ant metaphor to support a leader, leading by example. “There is no specific ant in charge in a colony, no central control. Yet each ant knows that its job is, and ants communicate with one another by way of very simple interactions; altogether they produce a very effective social network.” It may not reflect most organizations, but making that case against top-down centralized leadership is one that favors nature.

Activism is necessary and inspire change

“The zen master would say if you want to change government, you have to aim at changing corporations, and if you want to change corporation, you first have to change the consumers. Whoa, wait a minute! The consumer? That’s me. You mean I’m the one who has to change?”

Now more than ever we need to encourage civil democracy by speaking out, joining up, volunteering, or supporting these groups financially so we can still have a voice in democracy. Activists are the key citizens who have an infectious passion about the issues they support. “These are the people on the front lines, trying either to make the government obey its own laws or to recognize the need for a new law.”

This also means that it’s important for activists to obtain the necessary tools as they prepare to confront big business or big government. This means, learning organizational, business and marketing skills in order to compete with the media environment.

Nature loves diversity. So should we.

“Nature is not only evolving, and ecosystems support species that adapt either through catastrophic events or through natural selection. A healthy environment operates the same need for diversity and variety evident in a successful business, and that diversity evolve out of a commitment to constant change.”

There is nothing more human that centralization and complacency. We must use all our resources to combat them by embracing and instigating change. However, continuous change and innovation require maintaining a sense of urgency in order to be sustainable. Chouinard considered this as a mandate despite the laid-back atmosphere in Patagonia. “Only on businesses operating with a sense of urgency, dancing on the fringe, constantly evolving, open to diversity and new ways of doing things, are going to be here one hundred years from now.”
And lastly, “do well by doing good.”

Step One: Believe in Yourself

That’s what I’ve been working on right now. After a successful first week transitioning to Austin (finding an amazing apartment, landing couple of interviews, exploring the trail and going to great tech meetups), I found myself going into a job interview for the same job that I had prior. Long story short, it made me very discouraged as I considered a job with a higher pay but lower spirits.  I was reasoning to myself that “I can finally afford that woven chair that would look good in the patio.

But I realize, I wasn’t listening in my goals and desires nor did I believe in myself.

What does it even mean to believe in yourself?! Right after the interview, I called my friend/mentor to calibrate my spirits. A simple reminder than I am inspiring and I am worth it is enough. But to be reminded that I belong in the same room as much as everyone else is necessary. I can be part of the conversation! I don’t have to be a fly on the wall. I may be just a beginner, outsider, minority, or whatever, but those are just labels created to put me down. I believe in myself.

Self-doubt has a way of rippling outwards, perpetuating the closed-loop of more doubt. That paralyzing and greedy inner voice will do what ever it takes to devour confidence and leave no room for logic nor reason. ending the happiness that we worked so hard to realize and achieve.

When we fall outside of our comfort zone or strive to do something great, we fall out of invincibility. We stop believing in our worth.

I’ve been learning how to tame this beast called self-doubt. It starts by being present. Take time to pay attention and listen to how we feel and how we react to things. With a little understanding, self-knowledge and confidence, we start to understand the root causes of our insecurities and take the necessary and active steps to address our fear.

As a consultant in my old job, I learned that there are always ways to do something better. Everything has an opportunity for growth, even in ourselves. Especially in ourselves.

Unemployment aka this darn thing I once called gainful sabbatical, in all it’s beauty, has its ups and downs. I’m learning how to be patient with myself, really listening to the reasons why I quit my job. Yes, that means not returning back to my old job. Give myself some time to breathe. Realize that everything in life comes because our believe that they are possible. I’ve come this far. We’ve all come this far!

So make that necessary trip in front of the mirror and repeat after me: I believe in myself and I am a strong independent woman who belongs in spaces and conversation that I put myself in as much as anyone else. I believe in myself, therefore I make things possible.

My first week in Austin, TX

(Seventh Flag Coffee, Sunday, 8/6/17 1:24pm)

I want eavesdrop on every conversation. Be a fly on the lone star wall. Find solace while drinking a Topo Chico under the same Live Oak as everyone on the patio. Shed as many layers and perspire towards the Lady Bird basin. Leave my mark longer than water ring marks on a sunny afternoon.

I’ve spent a full week here in Austin, TX and I have been far from idle. If I’m not running, biking or climbing, I am perspiring in this heat along with everybody else. If my body’s not moving, my mind is running in circles as I learn the ways of Javascript. I’m slowly getting used to having a light load of things that frustrate me in this new city setting. At times, it seems ideal.

  1. Austin is a terrarium filled with 5’ agave succulents and air plants blooming from live oak branches.
  2. A great outfit is an indication of a great conversation.
  3. Resumes define nothing other than our abilities to listen and follow direction.
  4. This heat is a constant reminder of my childhood days in the Philippines. One is chosen and the other was endowed.
  5. Human beings are particles colliding. When the factor of heat is added, the movement increase as particles become more energetic. When human beings interact in urban settings, ideas are generated.  The states of the matter are always changing.
  6. I’ve been spending my days solving basic algorithm problems and am starting to see a pattern. To arrive to the solution, one must always break things down, perform necessary computational operations and put things back together. The same way with climbing: plan a route, practice necessary contortions and generate power and endurance, then, send it. With cooking: obtain ingredients, mix, add heat, then et voila! Especially with auditing: obtain data, establish controls, analyze, then visualize. Maybe that’s how life is, obtain experiences, meditate… then we die? Maybe we can break that down to defining goals and accomplishing them.
  7. Science helps me understand how the world works. But what else can?

Max Out Minimalism

When the Montreal-based clothing brand Frank and Oak rebranded to replace it’s serifs with sans-serifs logo last year, their creative director writes, “it’s a design approach that confidently stays out of the way when it needs to.” Oh boy, has the world been too burdensome?

You’ve probably seen them all over Instagram or online retail shops. The minimalist branding filled with an abundance of white space, sans-serif and and the friendly soothing doodles in brands like Glossier, Outdoor Voices and allbirds. Being a millennial myself that recently just moved in Austin, TX yesterday, I see this everywhere and even more so now. The grocer shopping at Whole foods with a canvas reusable bag, doing exactly what athleisure means; the small coffee shop near the chaotic boulevard filled with white walls, wood finishing, the absence of any geometric corners and sources single-origins beans from small farms in Burundi; the embodiment of succulents and cacti for self-expression; fast food giants like Cousin Subs and Panera rebranding to reduce any bold, serif fonts and loud colors for sobering clean lines, geometric shapes and primary colors. More brands are rising with minimalist marketing approaches and straightforward customer service, trying to counter any noise that has been established by large corporate identities in decades prior.

After all, we are a fidget spinning, woke feministing, anxious internetting generation trying to find some any pockets of calm and playful humor away from the bullshit of our lives and the clutter of our busy schedules. And I think there’s an opportunity that we can take from all this minimalist branding: it makes me want to scream!

We are drawn to these brands that have taken extra measures to strip away the layers and are good for the environment and the soul. But in end of the day, we are inherent consumers who need to constantly feed our egos. We are human, after all. Sometimes, we need a reminder that other people, cultures and causes exist, we can’t be too sensitized and avoid our problems. That’s why I love the grunge of New York City. When all this minimalist trends, like most trends, begin to die down, it is because of our impulses to express ourselves: to be bold and be loud and be human.