Skip to content

Instantly share code, notes, and snippets.

View danielres's full-sized avatar

Daniel Reszka danielres

View GitHub Profile
@danielres
danielres / facebook.rb
Created December 11, 2015 17:49 — forked from a14m/facebook.rb
Gist for manually OAuth2 facebook for Rails APIs
# lib/omniauth/facebook.rb
require 'httparty'
module Omniauth
class Facebook
include HTTParty
# The base uri for facebook graph API
base_uri 'https://graph.facebook.com/v2.3'
@danielres
danielres / es.sh
Last active December 15, 2015 01:49 — forked from sgringwe/es.sh
#cd ~
#sudo apt-get update
#sudo apt-get install openjdk-7-jre-headless -y
# Download the compiled elasticsearch rather than the source.
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.2.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@danielres
danielres / watchr.rb
Last active December 12, 2015 03:38 — forked from mattsmith/watchr.rb
ENV["WATCHR"] = "1"
system 'clear'
puts 'watching ...'
def notify(message)
title = "Watchr Test Results"
message.gsub!("No DRb server is running. Running in local process instead ...", "")
puts message
is_passing = message.match(/\s0\s(errors|failures)/) ? true : false
@danielres
danielres / missing_translations.rb
Created June 1, 2012 12:25 — forked from oriolgual/missing_translations.rb
No more missing translations in Rails thanks to Cucumber!
# features/support/missing_translations.rb
missing_translations = []
After do |scenario|
temp = all('.translation_missing')
if temp.any?
missing_translations << temp.to_a
raise "Missing Translation"
end
rendering a custom plugin
<% content_for :page_title do %>
<%= @destination.title %>
<% end %>
<% content_for :page_body do %>
<section>
<h1>Choose from our most popular recommended itineraries below</h1>
</section>
rendering a custom plugin
<% content_for :page_title do %>
<%= @destination.title %>
<% end %>
<% content_for :page_body do %>
<section>
<h1>Choose from our most popular recommended itineraries below</h1>
</section>
# shoestring.rb
# Rails template
# from Judd Kussrow of Octopus Inc
# $ rails new Project -Jm http://octopusinc.com/shoestring.rb
################################### MAINTENANCE ######
gem 'rails3-generators', :group => 'development'
gem 'nifty-generators', :group => 'development'
# How to re-use the menu partial for a submenu in Refinery CMS >= 0.9.8.5
# header menu (main menu) which hides its children.
<%= render :partial => "/shared/menu",
:locals => {
:dom_id => 'menu',
:css => 'menu',
:collection => @menu_pages,
:hide_children => true
} -%>
## based on the example at:
## http://gist.github.com/17371
##
## put me in lib/un_haml.rb (in the haml-based project)
##
## call me on the command line thus:
## $ script/runner UnHaml app/views/layouts/application.html.haml
## $ script/runner UnHaml */*/*/*.haml
##
class UnHaml < Haml::Engine
<p>
<a href="/signup/" class="multiline_button blue" style="width: 245px">
<big>Start Free Trial</big>
<small>30-days free! Signup in 60 seconds</small>
</a>
</p>
<p>
<a href="/signup/" class="multiline_button brown" style="width: 245px">
<big>Start Free Trial</big>