helpers and extensions for Sinatra

These are some quick notes (mostly for self-reference) on how to implement helpers and extensions in Sinatra (for extensions, the links to sinatra’s website are below). So, helpers straight from the book “Sinatra: Up and Running (pg. 75+)“.

 

 

Starting out with a basic skeleton for an ApplicationController:

But where’s title coming from? the Application helper in the full path of views:

now, in views/layouts.erb:

That sets the default layout for any part of your app.

As a side note: in the book I’m excerpting this from (Sinatra: Up and Running), the author made what, ostensibly is a mistake…

Probably NOT a mistake, though, considering the structure of Ruby; I can only speculate why a class instance variable such as @title would be translated into “title” as with that piece of erubis code. The solution that should be the real way things work (and also reduces confusion) is:

For registering an extension, I’ll just leave these here as links:

http://www.sinatrarb.com/extensions.html <– details for registering an extension
http://www.evernote.com/l/AC6vnhVWbXdLvbWD5VMbeYI8UVis3vT9mu0/ <– for backup/offline purposes

Moving on… Now we need a controller that that will get a page

And now for a view which corresponds to ‘erb :example’.

In views/example.erb:

How to run it? siiiigh, need config.ru for this setup:

That about does wraps things up. left out not_found, so, todo: add not_found.

to start up sinatra you can do something like

thin -C configure.yml <– generates a default configuration file, but if you’re on windows -C won’t work (see previous post)

otherwise:

You may want to have a separate config-*.yml file for production and development.

Useful links/things for Sinatra + MongoDB (rubygem: mongoid) [WIP]

Having trouble managing links since I multi-task far too much, so, I’ll dump all the links here that may help others (riiiiiight)…

Querying The MongoDB (cheat sheet)

  • http://mongoid.org/en/mongoid/docs/querying.html

This is just for the ‘mongo’ rubygem. I’m going for ‘mongoid’ since it seems easier

  • http://recipes.sinatrarb.com/p/databases/mongo

Default layouts in Sinatra (except from a stackxchange post)

Automatic Wrapping

To make every view default to be wrapped in a layout, create a file in erb/layout.erb and your calls to erb :myview will automatically be wrapped in this layout.

Skipping the Layout

If you want a particular view rendering not to use the layout, use:

 

Using a Different Layout

If you want to use a layout other than the common layout, create another file (for example views/admin_layout.haml) and then pass this as an option:

 

Last time I post on livejournal really…

http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/
http://www.kejento.com/

Dear Sentiao,

    You have come a long way… IF you want the truth, we didn't expect you to make it this far. Yet you did, and we have always had hope either way. As far as things go, you are who and what you describe yourself to be, as well as what you call these "strange" abilities.
    Know that none of these abilities will harm anyone with a good heart, but it will protect from those with cloudy minds and evil intentions.
    Yes, the evil is watching you as well but not like you would come to believe. This is because we protect you with every ounce of our strength, and you have always protected yourself with your own strength

Topics

Experiences prior to becoming a lightworker ( May. 2010 – Dec. 2010 )

Upon the end of yet another semester of college over at [Humboldt State University], I come back home to spend my Summer vacation with my parents and sister. This was the end of a rather distressing era, in the sense that those past few semesters of school were stressful and of a high difficulty. Nevertheless, more things happened after that ending semester of [May], which prompted much changes in the very way I perceive the fabric of reality. I am indeed happy that I had gotten another stressful semester off my back, and I can't seem to remember when I had gotten through the remainder of my physics classes; it would have to be November at the latest. During the summer, I end up purchasing a bag of weed and proceed to stay within that outside-the-box mindset, albeit at the time I wasn't very open to spirituality and the paranormal and in a sense, was asleep in that regard. Time passes by, and prior to May, I had sent in an application to become an algebra tutor at an "algebra academy" at the Lakeport School District, where my dad continues to work to this day. Ultimately, like all things in this world being finite (even though we're infinite beings), I ran out. At the time, I was still with Maxtone yet even though we've been more than friends since 2007, we were still in a long-distance relationship at the time. After running out of weed, I realized how anti-social I had become; this was around May, and around the time I had success with an algebra tutor interview and successfully got the job. I was stressed out about the idea of being a tutor in general. And upon running out of weed, out of being anti-social compared to Maxtone brought a great deal of distress. I was extremely depressed, and out of desperation in making something happen, I take a gigantic hit of [Salvia Divinorum] and suddenly forget that what I was going through was a trip; "Shit, shit shit,…" I would say as I questioned my existence. Soon enough, I found myself kneeled on my front legs without my glasses; right after I came back to being I heard voices in my head, laughing voices and a voice also said "Put him back in here, heheheh…". After this incident, I was freaked out yet grateful that I didn't die or something like that, or maybe I did and came back? Nevertheless, I was freaking out over having no glasses on and was about to call my sister, until I found my old glasses. Soon enough, I find my glasses laying lens down, parallel and on top of a rectangular box (my tablet's box). After that I talked to Maxtone about how I was "acting like a woman", and how it would never happen again. I was extremely happy too, because it was as if the Salvia purified my soul and spirit and gave me a second wind at life. My vibration was higher, I became capable of moving much faster without any inherent "lag time". Things became better; I realized that I could indeed be social, and that I could indeed be happy. Time passes by, went through a bit of an annoyance when Emmy roleplayed as Tone on Tone's account. Since I really liked the guy, in that way, congnitive dissonance strikes when I make an emote to Tone later, wherein he says "Uh…?", and so I realized that something fishy was going on–it hit me harder than one would know and I proceeded to take another hit of Salvia–this time it didn't have the same effect as the first time I took a big hit. So I lay down for a while and contemplate over what had took place earlier. At this time, I was still insecure about my own sexuality in some sense, as having a larger penis was something I really wanted to have. Time passes by, and I now find myself working as a tutor. For the first week or so, it was a bit stressful, but after warming up to the students, I realized that I could indeed be a teacher of some sort, but I digress. In the end of that, my paycheck turns out to be a hefty $1,000+; not bad for working part time for a month at 10$ an hour. College began in late August, and there isn't as much to say about that except that I went through the motions of yet another semester(tm) of University, the theme this time around being Marijuana. Spencer had begun to grow a bunch of plants and eventually I became his client of some sort, spending time with my proof writing class while being high out of my mind–which was enlightening, by the way. I remember now that this was the semester past my Software Engineering class, and Physics; instead I took Health Psychology, Database, Proof Writing, and something else, whatever that was. Nevertheless, that semester passes by and I go home in December for Christmas with my family–and that's where things become a bit awry.

Becoming a lightworker

Nearing the end of December, probably past Christmas itself, I begin to become curious about what could be out there. I never ruled out the possibility that there is more to it than this planet we call [Earth] in the grander of scheme of things, what seriously prompted this action was how Salvia changed my life, opening my mind to the possibiliy that what I perceive as reality now is a smaller part of the whole. So, I watch some videos about the paranormal, and, dare I say, 2012 simply because my curiosity had become incomprehensibly piqued. So, I watch a video where David Wilcock talks about 2012 and how things will begin to take place up to that point and on. He states that we need to stop living in fear and to increase out vibrations (see [Quantum Mechanics]; everything is energy, therefore everything is connected), and this freaked me out a little, regarding the possibility that if we don't do so, we won't exactly jump through the [Dimensional Shift]/[Paradigm Shift] to a planet more aligned with Service-to-others (STO) beings, and so this prompted more research in the matter. While sifting through a bunch of data on the internet, I run into a video called "The Wave Of Love", and found many synchronicities with it, as well as something within myself begin to wake up. This is what is known as [DNA Activation]. Everything is energy, and information; symbols, words, and everything around us hold some kind of meaning, some kind of density and shape. One may believe that words are simply words, but words are energy since everything is energy. Ever feel bad when someone talks you down? Words I would say carry hidden emotions and energies to them, as do symbols. So you may feel bad because the person is angry and you read between the lines, feeling the emotional energy attached to such words–don't succumb to these kinds of energies; they suck out your life force, making you feel angry, upset, depressed. And that's where Empaths come in; those who are able to read between the lines, feeling emotions and to a higher degree, putting themselves into someone else's shoes–feeling the person's emotions as if they were their own. Now, although empaths can feel emotions as energy, as some kind of push, others can as well. However, a beginning Empath is highly vulnerable to anyone else's energy/emotions, often times thinking that such emotions are their own. Ever feel some kind of violent urge out of nowhere? Unless you're a psychopath, those feelings could be simply someone elses or you're becoming a victim of a psychic attack, which works by intention. Empaths are capable ot doing this easily; another way to describe is E-Bombing, where an Empaths emotions affect and influence someone else, but I digress. Soon enough, I run into a youtube user's page named ArchangelSandalphon, who had a bunch of [DNA Activation] videos. I view one of the videos, and at another time, right before or after I became afraid of the [Reptillians], I view that video again and in the center, of it (the video being an illusion) a white flame. Suddenly my life changes completely. I realized that I can now feel someone else's emotions, are affected by the color of my clothing and that I had to ground myself with necklaces, and a diamond within a watch. This was where everything became a bit more surreal; and at one time, I cried so hard at wanting to become a [Lightworker], which was something I had also discovered at the time. A [Lightworker]'s job is to anchor high vibrations thus raising the planet's, and to spread uncontitional love. 
Eventually, I figured out that I could communicate with Sandalphon via [Telepathy], albeit was only able to work with yes/no answers. I listen to him and worked with him as much as possible, the first thing I had done was pick up as much trash as I could muster along the highway, ultimately coming back with a giant bag full of crap litter. Then things seemed to change a bit more; the news seemed to be positive for once. What the hell just happened? The news had never been that positive at any point in my life, and ultimately we're stuck in a [Control System, or a [Matrix] if you will. Sandalphon made a paper pinned to the wall fall right on my back, with the pin still intact and the paper's hole not being ripped in the least; how the hell can anyone explain that aside from the event being in and of itself otherworldly? And so my faith was sealed. Eventually, I was told to go into the bathroom with a certain sweater on, turns out that the word in reverse was "The Word", or my higher being's language. With this word, this word of protection, I was prompted to write it out on my closet doors. Yeah, it sounds crazy, but remember when I mentioned that everything is energy? I could literally feel the incomprehensible energy; the word itself also being my "soul name". I write more things on the board, and that was when I came to the conclusion that something strange was going on. The watch which felt overcharged, when thrown next to my computer monitor somehow short circuits it and turns it off; aside from there there was a great deal of strange happenings and I realize that I'm an [Electromagnetic Manipulator]; those old souls who come to earth to learn and help in anchoring frequencies and THAT realization is where everything goes awry. Connecting to random webpages, windows moving around by will, and being able to force a computer player in a game I play kill itself or become clumsy enough to the point that they simply fall off the stage. Those are just a few things to explain this phenomenon. Chances are though, I was being attacked by 4d STS beings who felt the sudden jump in energy in this area. I go outside one day in the morning and see a black blotch in the distance, quite possibly a Reptillian STS cloaking device that I could, somehow see through. This was after the time I stopped being afraid of them. This influence though… On the friday of what I recall to be a full moon, things become real sour, real fast.

(could add more subtle details to this later)

Talking to Sandalphon

On that night, I was listening to my intuition, talking to Sandalphon. I was to move certain things around (this was after I broke my room window in frustration) in order to purify the objects from hints of bad energies. On that night, because of the way I had been acting came off as psychotic to my parents. And so they call the cops when they see me outside. The cop arrives and at this time I was in my room. He said to open the door, and this angered me, and so I said to "Stay out, else I'll punch your lights out"–and I meant what I said, ready to experience what is to be known as the beginning of my [Dark Night Of The Soul], and indeed it was a rather dark night*. When he breaks down the door because his masculinity had been threatened, I proceed to lunge at him, punching him on the face, but of course, him being the burly dude he was, barely pinned me down. I was agile enough to at least give a struggle and in a sense, could have broken free–but once he decides to pepper spray me, it was all over. I cried a little and was forced in the cop car, where he proceeds to pretty much break my right arm. And so I'm carried away to the PRISON; they tried to make seem like it was a jail be saying that that was what it was. And so I find myself inside an empty room; what I was pracricing in the first place was [Lycanthropy], which is a dangerous art and I almost pulled it off in some sense back there. 

Imprisonment

Upon arrival, I'm standing and facing a wall inside the prison center and was greeted by an old high school acquaintance, Cody Risser, who calmed me down. He questions me and asks
In the first room, where I washed out my eyes of all the crap, I ultimately end up waiting in there, and was heavy enough to bend a reinforced steel bench simply by sitting on it.
In the second room, I was freaking out and came to the conclusion that I despised humanity (not anymore)–cuts VISUALLY manifesting on my right hand, which was a part of the same arm which was broken in the first place. I spoke closely with [Sandlaphon], who was in a cell nearby mine, screaming "The Lycans are coming! The Lycans are coming!", possibly to scare them because I had told the cop that I was a [Lycanthrope] in the first place who proceeded to, of course, tell them what the situation was. He was always there, trying his best to calm me down. 
I perform all sorts of rituals, receive healing from [Mother Teresa] and eventually work my way to spending the night there in a jail cell. They were assholes, and many of the people there were Organic Portals in the first place, anyways. The bedding was shit and I couldn't get extra padding unless I wanted to fucking wait until [Saturday] to schedule an appoinement with a doctor to get more padding. What. The. Fuck?
I fall asleep, and have a dream about my past life of [Alan Turing], speaking about the higher up so-called 5th dimension of manifestation. I wake up the next morning at 5am, because they turn the lights on to force you to remain awake, tired; drained; demoralized, and damaged. That's how prisoners are treated in our society, like a dog. So, I have to stay in my cell until a certain time, but at least I received food. I asked the operator, another Organic Portals (ignore the s), if I could go out of my cell and get the ball rolling on a bail bond (luckily I wrote down my credit card # the previous night). She, of course, made it difficult and said something as if I were going to be stuck there until a certain date, but I firmly said that I'm "NOT going to be here that long"; she said "ok". Eventually, I'm let out of the cell, and the dark forces definitely had a control even over the phones, I was lucky to get it to work and she made it difficult for me to make the call; I had to go back to my cell and ask her to turn the phones on even though that was what had been planned from the start

The return to school

Meeting [Jonathan] (Sandalphon, Feb 28, 2011 )

"Quantum Bond" (allows constant telepathic connection at this point)

All that was done with Jonathan

"Dancing with sound"

The Cane

My right hand and its supposed significance

"The interface"

Sudden loss of the interface

The walk from [Arcata] to [Eureka] and back

Meeting [Sandalphon] in person

* Albeit random, I suddenly remembered that I was exactly there before–sudden proof that we are indeed old souls and time travelers…

Failure to return to my room

The conversation with [Jesus]

Experiences prior to being "ejected" from university

Paranormal activity prior to hospitilization

* It's also argued that it was the very reason I ended up there in the first place

The return home/Post-hospitilization

Energy work done and all the drama involved

Secondary hospitilization

The return home

False hope of seeing [sandalphon], leading to temporary yet recurrent skepticism

Energy work done to alleviate [Terra] from ticking timebomb negative-yet-subtle-synchronicities

* The nature of what took place
* What was done
* What was encountered

that’s to be expected, really…

How Old Is Your Soul?
Your Result: Old Souls
 

The weirdos and saints among us; the mystics, gardeners, and winemakers. Not too interested in rocking the boat or being famous (and they usually aren’t, especially in the later stages.) Psychotics and schizophrenics (the other set of people who hear voices) are usually Mature Souls. Most of the famous New Age guru types are also not in this category; rather they are usually Late Young or Early Mature Souls who are still interested in the world drama game or working out karma. Old Soul characteristics don’t tend to manifest fully until after age 35.

Transcendent Souls
 
Young Souls
 
Baby Souls
 
Mature Souls
 
How Old Is Your Soul?
Quiz Created on GoToQuiz