Skip to content

Instantly share code, notes, and snippets.

ratingText = {
singular: {
"Closed": L("1_person_voted_to_get_this_issue_fixed", "1 person voted to get this issue fixed"),
"Archived": L("1_person_voted_to_get_this_issue_fixed", "1 person voted to get this issue fixed"),
default: L("1_person_wants_this_fixed", "1 person wants this fixed")
},
plural: {
"Closed": L("people_voted_to_get_this_issue_fixed", "%s people voted to get this issue fixed"),
"Archived": L("people_voted_to_get_this_issue_fixed", "%s people voted to get this issue fixed"),
default: L("people_want_this_fixed", "%s people want this fixed")
def missing(message)
if message.is_a? Symbol
puts "The environment is missing #{message.to_s.upcase}"
else
puts message
end
end
desc "Check the environment for proper setup"
task :checkenv do
@danbernier
danbernier / Rakefile
Created April 18, 2013 20:16 — forked from sukima/Rakefile
def missing(message)
if message.is_a? Symbol
puts "The environment is missing #{message.to_s.upcase}"
else
puts message
end
end
desc "Check the environment for proper setup"
task :checkenv do
@danbernier
danbernier / gist:5395929
Created April 16, 2013 13:34
Getting back undefined
(function(undefined) {
// In here, undefined is back to normal,
// because we passed the function no params!
})();
@danbernier
danbernier / issue.js
Last active May 10, 2024 00:03 — forked from sukima/issue.js
This is more what I was after - this way, ratingText is created once, AND it's private.
var getRatingText = (function() {
var ratingText = {
singular: {
"Closed": L("1_person_voted_to_get_this_issue_fixed", "1 person voted to get this issue fixed"),
"Archived": L("1_person_voted_to_get_this_issue_fixed", "1 person voted to get this issue fixed"),
default: L("1_person_wants_this_fixed", "1 person wants this fixed")
},
plural: {
"Closed": L("people_voted_to_get_this_issue_fixed", "%s people voted to get this issue fixed"),
@JADC362
JADC362 / ROS2DebugVSCode.md
Last active May 10, 2024 00:03
Debug ROS2 C++ node on VSCode (Ubuntu)

Debug ROS2 C++ node on VSCode (Ubuntu)

Description

This is a small tutorial on how to debug a ROS2 C++ node usign VSCode.

Requeriments

This implementation was done using:

@danbernier
danbernier / gist:7378358
Created November 8, 2013 21:58
A mix-in module for a Rails model that's backed by a column like `{column-name} ENUM('true', 'false')
module HasFakeBooleanColumns
def self.wallpaper_over_fake(column_name)
define_method(column_name) do
self.attributes(column_name) == 'true'
end
define_method("#{column_name)=".to_sym) do |value|
self.update_attribute(column_name, value == 'true')
end
end
@cocopon
cocopon / Easing.pde
Last active May 10, 2024 00:03
A class that brings Robert Penner's easing functions into Processing
/*
* Easing.pde - brings Robert Penner's easing functions into Processing
* (c) 2015 cocopon.
*
* See the following to learn more about these famous functions:
* http://www.robertpenner.com/easing/
*
* License:
* http://www.robertpenner.com/easing_terms_of_use.html
*/
@danbernier
danbernier / gist:1231073
Created September 21, 2011 02:38
Markdown insists my String is an Array
# @paragraphs is an Array of Strings - various puts'es confirm this.
@paragraphs.each do |paragraph|
renderer = HH::LessonParaRenderer.new(container)
markdown = Redcarpet::Markdown.new(renderer)
p paragraph # Just checking - it's a String!
# raises: <TypeError: wrong argument type Array (expected String)>
markdown.render(paragraph)
end
@danbernier
danbernier / gist:1579738
Created January 8, 2012 21:20
Ruby lets you add instance variables at runtime
ruby-1.9.2-p290 :001 > class Foo
ruby-1.9.2-p290 :002?> def bonk
ruby-1.9.2-p290 :003?> @bonk = nil
ruby-1.9.2-p290 :004?> end
ruby-1.9.2-p290 :005?> end
=> nil
ruby-1.9.2-p290 :006 > f = Foo.new
=> #<Foo:0x007ff15c1e65b8>
ruby-1.9.2-p290 :007 > f.bonk
=> nil