Skip to content

Instantly share code, notes, and snippets.

View wefarrell's full-sized avatar
:octocat:

Will Farrell wefarrell

:octocat:
View GitHub Profile
require 'htmltoword'
require 'mustache'
class HtmlToOpenXml
include Htmltoword::XSLTHelper
def convert(html)
node = Nokogiri::HTML(html.gsub(/>\s+</, '><'))
node = xslt(stylesheet_name: 'cleanup').transform(node)
node = xslt(stylesheet_name: 'inline_elements').transform(node)
Htmltoword::Document.new("").transform_doc_xml(Nokogiri::HTML("<ul><li>hi</li></ul>"))
def document
Htmltoword::Document.new("")
end
# test-ransacker-arel-present-predicate.rb
# Run it in your console with: `ruby test-ransacker-arel-present-predicate.rb`
# If you change the gem dependencies, run it with:
# `rm gemfile* && ruby test-ransacker-arel-present-predicate.rb`
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
expect = require('chai').expect
_ = require('lodash')
housesDeliveredGrid = (commands) ->
grid = {0:{0:1}}
currentX = 0
currentY = 0
@wefarrell
wefarrell / gist:7874364
Created December 9, 2013 15:53
Last Night's Dream 12/9/13
Last night I was fully lucid and was able to meditate. It's a little bit harder to remember because it happened at the beginning of the dream. I was in a dojo and to my left was another person who was also meditating. On the wall was a poster with my face on it. I remember debating whether I should be meditating whilst seated or lying down. I was concerned that if I meditated while seated I would wake up in the real world, but if I was lying down I might fall asleep within the dream.
Later on a woman, who was the crazy mother of an acquaintance of mine, shaved my head without my permission. This angered me and i wasn't sure what to do. I probably should have forgiven her because I was still lucid, but I was upset and the people around me convinced me not to be a pushover so I called the cops. She ran and I chased her. At some point she pulled out a gun and started shooting at me, but the bullets didn't hit me. Maybe because I was still lucid? Meanwhile the cops were chasing her and eventually they shot and k
@wefarrell
wefarrell / gist:7755049
Last active December 30, 2015 01:19
Last Night's Dream 12/2/13
Last night I had dreams within dreams. I was in a grassy region that was completely flooded with multicolored water because of rains. I walked around and found my dad's house, the house I grew up in. I sat on the steps up to the house from the back yard and realizing it was a dream, I attempted to meditate. I was unable to concentrate because I kept getting woken up by various people coming into my apartment trying to get me out of bed. At first it was my dad, then my sister and some of her friends. I became angry and kept attempting to fall back asleep so I could meditate, but as soon as I tried someone new would come in and interrupt me. Little did I realize that I was never actually getting woken up, and the interruptions were part of the dream. However, I do remember having the insight that these "real world" interruptions were no different than thoughts that came and went in my head.
I distinctly remember passing in between the dream within the dream, and the regular dream. When I would wake up from the
@wefarrell
wefarrell / Untitled 1.txt
Created November 28, 2013 19:55
Historic Dream 4
From ages 18-21 I went through a period where I had many significant dreams. I don't remember the particular order, but the more significant ones have etched themselves thoroughly in my memory.
Three Churches
When the dream started out I was a member of some kind of new age church. The building had a lot of light in it and the atmosphere seemed very cultish. They claimed to be christian but it became clear they were christian in name only. In the church there were a series of relics, the most important of which was a glass box filled with sand. I disrupted this relic by placing a cross inside of it, which angered the congregation to the point that they wanted me dead. They wanted to crucify me but I insisted that if they were to crucify me, they do so upside down, much like the early christian martyrs. This caused a great argument amongst the congregation and in the commotion I was able to escape my martyrdom and run away from the church. I came upon a picnic of a large group of people and they welcomed me w
@wefarrell
wefarrell / Untitled 1.txt
Created November 28, 2013 19:54
Historic Dream 3
In another dream that I had when I was in college and in bed with my then girlfriend Amy, our bed was a hospital bed. We were having sex and next to us was a sick girl who doctors were trying to save. For some reason she had chains around her arms, legs, and neck. She died and began to decay. Te doctors carted her bed off and her head fell onto one of the posts of our bed, looking straight at us. We weren't scared, and decided to use the opportunity to talk to this representation of death itself. Amy asked the head "what's my name?" to which the head responded "Amy". When it talked it's mouth would move but the sounds were not audible, rather we could hear them telepathically. I asked the head the same question, "What's my name" and the head responded "Everyone calls you will but your real name is ______". It was a word of at least 6 syllables which I now assume was sanskrit. It began with either "Nava" or "Vana".
@wefarrell
wefarrell / Untitled 1.txt
Created November 28, 2013 19:54
Historic Dream 2
When I first went away to college at BU and lived with my then girlfriend Amy, I had two significant dreams that I remember. The first wasn't clear but there were a few things that have etched themselves in my memory. I remember looking over at my girlfriend Amy, who was a fish in the dream. Next to me there was a jackal/minotaur figure with the head of a bull or dear or some other beast. He was a deity of some sort and he told me that because of who I am I wouldn't find the same sense of happiness/satisfaction from a relationship that others do. I believe he showed me something about myself, possibly from a past life, that I have since forgotten. At first I thought I was being punished for a transgression in a past life, but I've come to believe that it's because my consciousness is more evolved.
@wefarrell
wefarrell / Historic dream 1
Created November 28, 2013 19:53
Historic Dream 1
The earliest significant dream that I can remember happened when I was in high school and running cross country. I was probably within a year of age 15 or so.
I was running on a trail in the woods when I came upon a lagoon. I was on a ledge and the lagoon was maybe 50 or so feet below me. In this lagoon was a beautiful woman with long black hair skinny dipping. She invited me in and I ran down, taking off my clothes, to meet her in this pool. We began kissing and making love and then she turned into a giant black water snake, and then into thousands of water snakes that swam off in all directions.
Black water snakes had been a recurring theme in my dreams from my early to mid adolescence.