Skip to content

Instantly share code, notes, and snippets.

View doombongo's full-sized avatar

Michael Lussier doombongo

  • GitLab
  • Fayetteville, Arkansas
View GitHub Profile
var myServices = angular.module('myServices', ['elasticsearch']);
myServices.service('es', ['esFactory',
function (esFactory, $http) {
return esFactory({
host: 'localhost:9200',
});
}]);
myServices.factory('searchService', ['es', function(es) {
@doombongo
doombongo / gist:6245494
Created August 15, 2013 22:20
Column size not effected
<%= form_for [@commentable, @comment] do |f| %>
<div class="span12">
<%= f.text_area :content, rows: 5, columns: 40 , placeholder: "Write a comment..." %>
</div>
<% end %>
@doombongo
doombongo / iterm2.sh
Created August 13, 2013 01:34
can't connect to local host
=> Booting Thin
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
>> Thin web server (v1.5.1 codename Straight Razor)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:3000, CTRL+C to stop
vagrant@precise32:/vagrant$ bundle exec rails s
=> Booting Thin
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize': could not connect to server: Connection refused (PGError)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
@doombongo
doombongo / status.rb
Last active December 11, 2015 09:58
getting nothing when running 'ruby tweetstream.rb'
# Returns a Tweet
#
# @see https://dev.twitter.com/docs/api/1.1/get/statuses/show/:id
# @rate_limited Yes
# @authentication_required Requires user context
# @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
# @return [Twitter::Tweet] The requested Tweet.
# @param id [Integer] A Tweet ID.
# @param options [Hash] A customizable set of options.
# @option options [Boolean, String, Integer] :trim_user Each tweet returned in a timeline will include a user object with only the author's numerical ID when set to true, 't' or 1.
Grackle::TwitterError: Unable to decode response: 757: unexpected token at '<?xml version="1.0" encoding="UTF-8"?>
<hash>
<request>/1/statueses/user_timeline.json?screen_name=my_event_organizer</request>
<error>Timestamp out of bounds</error>
</hash>
'
from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/grackle-0.2.1/lib/grackle/client.rb:274:in `rescue in process_response'
from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/grackle-0.2.1/lib/grackle/client.rb:265:in `process_response'
from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/grackle-0.2.1/lib/grackle/client.rb:241:in `call_with_format'
from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/grackle-0.2.1/lib/grackle/client.rb:221:in `append'
text = "bIg mouse"
redacted = "big"
words = text.split(" ")
words.each do |word|
if word != redacted
print word + " "
else
text = "bIg mouse"
redacted = "big"
words = text.split(" ")
words.each do |word|
if word != redacted
print word + " "
@doombongo
doombongo / index.html.erb
Created December 11, 2012 17:34
link to image
<% @blogs.each do |blog| %>
<div class="index_image">
<%= link_to image_tag("blog.image.thumb.to_s"), blog %>
</div>
<%end%>
@doombongo
doombongo / application.html.erb
Created December 3, 2012 19:12
current is a red arrow sitting next to the nav link
<li> <%= link_to "About Us", about_path, class: "#{cp(about_path)} link" %></li>