Skip to content

Instantly share code, notes, and snippets.

View avinashacco's full-sized avatar

Avinash Vundyala avinashacco

View GitHub Profile
@avinashacco
avinashacco / AutowiringSpringBeanJobFactory.java
Created August 6, 2017 18:07 — forked from jeffsheets/AutowiringSpringBeanJobFactory.java
Configuring Quartz 2.1.7 with Spring 3.1.3 in clustered mode
/**
* 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();
}

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"

npm adduser

@avinashacco
avinashacco / rabbitMqInstallation
Created June 10, 2015 17:31
Install Rabbit MQ Server and GUI on Windows
Install Guide:
1. Download Rabbit MQ Server from
https://www.rabbitmq.com/download.html
2. Install the RabbitMQ Server
3. Open Console (set environment variable or open RabbitMQ CMD) and run the following command
rabbitmq-plugins enable rabbitmq_management
Importing Mongodb Documents to Solr:
http://blog.mongodb.org/post/29127828146/introducing-mongo-connector
http://stackoverflow.com/questions/21450555/steps-to-connect-mongodb-and-solr-using-dataimporthandler
https://github.com/james75/SolrMongoImporter
Solr
http://lucene.apache.org/solr/quickstart.html
Node Solr
http://lbdremy.github.io/solr-node-client/code/add.js.html
@avinashacco
avinashacco / StreamsInNodeJS
Last active August 29, 2015 14:05
Streams
Streams
--------------------------------------------------------------------------------------------
There is a lot of data that get transfered over the network and we would want to start processing the
moment we get some packets.
We do this with the help of streams. Streams can be readable, writable, or both.
http.createServer(function(request,response){
});
@avinashacco
avinashacco / EventsInNodeJS
Last active August 29, 2015 14:05
Events in Node JS
Events
--------------------------------------------------------------------------------------------
The dom triggers events. Like dom many objects in Node emits events. Those objects that emit events inherit
from EventEmittter.
For example the net.Server class inherits from EventEmitter and emits the request event. The fs.readStream
class returns a Stream that inherits the EventEmitter that emits the data event as data is read out of the file.
Example of Custome Event Emitter:
--------------------------------------------------------------------------------------------