This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # WikiPage(id: integer, title: string, fetched_at: date, created_at: datetime, updated_at: datetime, ancestry: string, url: string, is_root: boolean, wiki_tree_id: integer) | |
| # The whole code is at https://github.com/brenes/Wiki-Roots | |
| class WikiPage < ActiveRecord::Base | |
| belongs_to :tree, :class_name => "WikiTree" | |
| # ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>fileTypes</key> | |
| <array> | |
| <string>feature</string> | |
| </array> | |
| <key>firstLineMatch</key> | |
| <string>기능|機能|功能|フィーチャ|خاصية|תכונה|Функціонал|Функционалност|Функционал|Особина|Могућност|Özellik|Właściwość|Tính năng|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd(.*)</string> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Starting on 2011/09/29 Twitter Streaming API requires SSL to access. | |
| # Twitter stream gem is a gem built over EventMachine to get access to Twitter Streaming API | |
| # Unfortunately Twitter Stream uses http by default, not https. | |
| # We have to pass two extra options to the connect method | |
| stream = Twitter::JSONStream.connect( | |
| :path => "/1/statuses/filter.json?track=20N", | |
| :auth => "USER:PASS", | |
| # And the extra params!! | |
| :port => 443, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # I had Cucumber / Mundo Pepino configured with Webrat and used jtrupiano's Rack::Rewrite (https://github.com/jtrupiano/rack-rewrite) to handle redirections between some old URLs and new ones | |
| # When I tested if redirections were being handled correctly I encountered with a big issue: URL of the redirection appeared to be nil. | |
| # I tested it manually and redirections were fine, so I though this could be a problem with the interaction between Rack::Rewrite and Webrat. | |
| # After some dig and debug on the gems (cucumber, webrat and rack mostly) code I found the problem: | |
| # Line 283 of lib/webrat/core/session.rb | |
| # | |
| # def response_location | |
| # response.headers["Location"] | |
| # end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Gemfile.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # So you want to start developing an already "woking" project. No | |
| # bundle, config.gem's not present or messing up dependencies. Fear | |
| # not! | |
| # Do a "gem list" wherever the project is already working | |
| # (production?, some colleage machine?). Make a file with this format: | |
| # | |
| # chronic (0.2.3) | |
| # colored (1.1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
| <title>Testing Pie Chart</title> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.1.3"></script> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?2.1.3"></script> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.1.3"></script> | |
| <style type="text/css"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def set_locale | |
| # Si estoy en NavItemsController, y el match se hace con *, el locale | |
| # en realidad está en el primer item de nicetitles | |
| if controller_name == "nav_items" && | |
| params[:nicetitles].present? && | |
| Settings.app.locales.keys.map(&:to_s).include?(params[:nicetitles].first) | |
| I18n.locale = params[:nicetitles].shift | |
| elsif params[:locale].present? | |
| I18n.locale = params[:locale] | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| field :parent_id, :enum do | |
| enum do | |
| (ProcessType.select("id, name")||[]).map{|c|[c.name, c.id]} || [] #this is just an example though | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # DelayedJob in its latest version allows to disable job delaying by a simple Delayed::Worker.delay_jobs = false. | |
| # If we're using a previous version (i.e. the branch compatible with Rails 2), we need to open Delayed proxy class and force it to perform the works | |
| # This way, in testing we can test mail delivieries and others | |
| module Delayed | |
| module MessageSending | |
| def send_later(method, *args) | |
| Delayed::PerformableMethod.new(self, method.to_sym, args).perform | |
| end | |
| end | |
| end |