Skip to content

Instantly share code, notes, and snippets.

Vendo virado

Em uma caluladora de bolso os dígitos são representados por pequenas barras no visor de cristal líquido:

Quando olhamos com o visor de cabeça para baixo alguns números ainda podem ser lidos (só que com outros valores). Por exemplo, 1995 vira 5661. O quinto número que pode ser lido de cabeça para baixo é 8, e o décimo-quinto é 21, que passa a valer 12 quando é visto de cabeça para baixo.

Você deve responder a pergunta:

@myjpa
myjpa / Ember.DebouncedTextField.coffee
Last active November 26, 2020 07:18
Debounced Ember TextField
# monkey patching Ember.TextField so that you can add delay=500 to make the
# TextField to update the binding value in debounced manner with delay of 500ms.
# That is it will only update the value if there is a unsubmitted change and
# no user input for the specified delay period.
# While no delay spcified, it's just the plain Ember.TextField
# usage in handlebars:
# {{view Ember.TextField valueBinding="someValue" delay=500}}
Ember.TextField.reopen {
delay: null # delayed period for updating the binding value in ms
_debouncedSet: (key,value,delay)->Ember.run.debounce(this, Ember.set, this, key, value, delay)
@jbenet
jbenet / simple-git-branching-model.md
Last active July 31, 2024 06:29
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index e948314..a24b35a 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -321,7 +321,13 @@ module ActiveSupport
_normalize_legacy_filter(kind, filter)
scopes = Array(chain.config[:scope])
- method_to_call = scopes.map{ |s| s.is_a?(Symbol) ? send(s) : s }.join("_")
+ method_to_call = scopes.map { |s|
@metaskills
metaskills / wait_until.rb
Last active May 2, 2024 01:51
Never sleep() using Capybara!
# WAIT! Do consider that `wait` may not be needed. This article describes
# that reasoning. Please read it and make informed decisions.
# https://www.varvet.com/blog/why-wait_until-was-removed-from-capybara/
# Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations?
describe 'Modal' do
should 'display login errors' do
visit root_path
@jasonrudolph
jasonrudolph / about.md
Last active May 14, 2024 16:36
Programming Achievements: How to Level Up as a Developer
@defunkt
defunkt / gemspec
Created March 9, 2010 01:41
Quickly create a gemspec.
#!/usr/bin/env ruby
# Usage: gemspec [-s] GEMNAME
#
# Prints a basic gemspec for GEMNAME based on your git-config info.
# If -s is passed, saves it as a GEMNAME.gemspec in the current
# directory. Otherwise prints to standard output.
#
# Once you check this gemspec into your project, releasing a new gem
# is dead simple:
#