First add your twitter username and password. Then server.rb and once it's started open websocket.html in your browser. You should see some tweets appear. If not take a look at the javascript console.
This file contains 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
#The following is the order of the callbacks for a call to save (and save!) on a | |
#record that has never been saved before: | |
before_validation | |
before_validation :on => :create | |
after_validation | |
after_validation :on => :create | |
before_save | |
before_create | |
after_create |
This file contains 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
<plugin> | |
<artifactId>maven-antrun-plugin</artifactId> | |
<version>1.7</version> | |
<executions> | |
<execution> | |
<phase>generate-sources</phase> | |
<configuration> | |
<target name="building"> | |
<echo> | |
--------------------------------------------------- |
This file contains 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
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |
This file contains 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
var UserPurchases = (function() { | |
function UserPurchases(Q, UserSession, PurchaseModals) { | |
this.Q = Q; | |
this.UserSession = UserSession; | |
this.PurchaseModals = PurchaseModals; | |
} | |
UserPurchases.prototype.purchase = function(video) { | |
this.video = video; |
This file contains 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
/** | |
* Autowire Quartz Jobs with Spring context dependencies | |
* @see http://stackoverflow.com/questions/6990767/inject-bean-reference-into-a-quartz-job-in-spring/15211030#15211030 | |
*/ | |
public final class AutowiringSpringBeanJobFactory extends SpringBeanJobFactory implements ApplicationContextAware { | |
private transient AutowireCapableBeanFactory beanFactory; | |
public void setApplicationContext(final ApplicationContext context) { | |
beanFactory = context.getAutowireCapableBeanFactory(); | |
} |
This file contains 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
function enforceDependencies(klass, options, deps){ | |
deps = _.filter(deps, function(depName){ | |
if( !options[depName] ){ | |
throw new Error('Missing required dependency: '+ depName); | |
} | |
return !!klass[depName]; | |
}); | |
_.extend(klass, _.pick(options, deps)); | |
} |
This file contains 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
gem 'foreman' | |
gem 'puma' |
This file contains 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
public class Calculadora { | |
private static final Prova _ = of(Prova.class); | |
public double mediaDeProvas(List<Prova> provas) { | |
return mediaPonderada(provas, function(_.getNota()), function(_.getPeso())); | |
} | |
public <T> double mediaPonderada(List<T> lista, Function<T, Double> valor, Function<T, Double> peso) { | |
double soma = 0.0; | |
double somaPesos = 0.0; |
This file contains 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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
OlderNewer