(Several of these git examples have been extracted from the book 'Pragmatic guide to GIT' of Travis Swicegood )
git config --global user.name "Fernando Guillen"
git config --global user.email "[email protected]"
cd /develop/myrepo
// Reachability Objective-C minimal version | |
// I'm new so memory leaks are possible on this code | |
// Extracted from: | |
// http://www.idevapps.com/forum/archive/index.php/t-3329.html | |
// (look for an imported_kelvin's post) | |
// | |
+ (BOOL)networkAvailable{ | |
SCNetworkReachabilityRef netreach; | |
SCNetworkConnectionFlags flags; |
# Integration Test for ExceptionNotifier | |
# Please change this values for your own purposes: | |
# * UsersController | |
# * users_path | |
# | |
# Author: http://fernandoguillen.info | |
# | |
require 'test_helper' |
A backup of http://sites.google.com/site/redcodenl/creating-shazam-in-java-1 just in case | |
Why is this necessary? Read http://sites.google.com/site/redcodenl/patent-infringement | |
Please fork, tweet about, etc. | |
---- | |
Creating Shazam in Java | |
A couple of days ago I encountered this article: How Shazam Works | |
This got me interested in how a program like Shazam works… And more importantly, how hard is it to program something similar in Java? |
God::Contacts::Email.defaults do |d| | |
d.from_email = '[email protected]' | |
d.delivery_method = :sendmail | |
end | |
God.contact(:email) do |c| | |
c.name = 'fguillen' | |
c.group = 'admins' | |
c.to_email = '[email protected]' | |
end |
# application_controller.rb | |
before_filter :set_locale | |
private | |
def set_locale | |
new_locale = params[:locale] || cookies[:locale] || extract_locale_from_accept_language_header || I18n.default_locale | |
if I18n.available_locales.include?( new_locale.to_sym ) | |
I18n.locale = new_locale |
From 4b8ac1aa47900037d31896e3564568510b3fd879 Mon Sep 17 00:00:00 2001 | |
From: Fernando Guillen <[email protected]> | |
Date: Tue, 17 Aug 2010 19:07:55 +0200 | |
Subject: [PATCH] Alert if trying to create an empty Quote | |
--- | |
public/stylesheets/screen.css | 11 ++++++++++- | |
quotes.rb | 31 +++++++++++++++++++++++++++---- | |
spec/adding_quotes_spec.rb | 17 +++++++++++++++++ | |
spec/amending_quotes_spec.rb | 17 +++++++++++++++++ |
require 'rubygems' | |
require 'test/unit' | |
require 'mustache' | |
class MustacheNestedTest < Test::Unit::TestCase | |
def test_nested_section_with_same_member_name | |
template = <<template | |
{{#mothers}} | |
{{name}}: {{#children}}{{name}}({{name}}) {{/children}}| | |
{{/mothers}} |
(Several of these git examples have been extracted from the book 'Pragmatic guide to GIT' of Travis Swicegood )
git config --global user.name "Fernando Guillen"
git config --global user.email "[email protected]"
cd /develop/myrepo
# Not work very well but enough for prototiping | |
# TODO: not very clear url expression | |
URL_REGEX = /([\S]+\.[\S]+)/ | |
def self.activate_links( text ) | |
text.gsub!( URL_REGEX ) do |url| | |
clean_url = url.gsub( /http:\/\//i, '' ) | |
"<a href=\"http://#{clean_url}\">#{url}</a>" | |
end | |
require 'rubygems' | |
require 'test/unit' | |
require 'mocha' | |
class MyMochaTest < Test::Unit::TestCase | |
def test_exceptation | |
string = 'wadus string' | |
string.expects( :downcase ) | |
assert true | |
end |