Skip to content

Instantly share code, notes, and snippets.

@valotas
valotas / run.js
Created August 27, 2011 14:23
Trying to make a small scrapy like app with nodejs
var scrapy = require('./scrapy.js').scrapy,
getAdFromTD = function( $td ) {
var ad = {
title: $td.find('a').html().replace(/\s*$/g, '')
},
type;
$td = $td.next();
ad.address = $td.find('a').html().replace( /<br>/g, ',' );
@valotas
valotas / tomcat.sh
Created May 31, 2011 07:11
Tomcat init.d script
#!/bin/bash
#
# tomcat7 This shell script takes care of starting and stopping Tomcat
#
# chkconfig: - 80 20
#
### BEGIN INIT INFO
# Provides: tomcat7
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
@valotas
valotas / GuiceHandler.java
Created May 30, 2011 15:25
Grizzly 2 with guice 3
import javax.servlet.ServletContextEvent;
import org.glassfish.grizzly.servlet.ServletHandler;
import com.google.inject.servlet.GuiceFilter;
import com.google.inject.servlet.GuiceServletContextListener;
public class GuiceHandler extends ServletHandler {
private static final Logger logger = Logger.getLogger(GuiceHandler.class.getName());
private final GuiceServletContextListener guiceServletContextListener;