Skip to content

Instantly share code, notes, and snippets.

Georgios Valotasios valotas

Block or report user

Report or block valotas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
valotas /
Created Jul 24, 2015
git-hooks: check if branch name is on par with pom's version
# Run the following command in the root of your project to install this pre-push hook:
# cp git-hooks/pre-push .git/hooks/pre-push; chmod 700 .git/hooks/pre-push
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
BRANCH_NAME=$(git symbolic-ref --short HEAD)
valotas / run.js
Created Aug 27, 2011
Trying to make a small scrapy like app with nodejs
View run.js
var scrapy = require('./scrapy.js').scrapy,
getAdFromTD = function( $td ) {
var ad = {
title: $td.find('a').html().replace(/\s*$/g, '')
$td = $;
ad.address = $td.find('a').html().replace( /<br>/g, ',' );
valotas /
Created Sep 11, 2011
Decorator pattern with HttpServerRequest
public class HttpServletRequestDecoratorFilter implements Filter {
public void init(FilterConfig filterConfig) throws ServletException {
//do nothing
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
request = decorate(request);
public class BetterJerseyTest extends JerseyTest {
//Fire up jersey with Guice
private static final AppDescriptor APP_DESCRIPTOR = new WebAppDescriptor.Builder("")
.clientConfig(new DefaultClientConfig(JacksonJaxbJsonProvider.class))
valotas /
Created May 1, 2012
Jersey + Guice + Grizzly
public class GrizzlyWebServer {
private static final Logger logger = LoggerFactory.getLogger(GrizzlyWebServerService.class);
public static final void main(String[] args) throws IllegalArgumentException, IOException {
HttpServer server = startWebServer();
System.out.println("Jersey started");
if (logger.isInfoEnabled()) {"Jersey web app started with Grizzly web container");
valotas / override-app-render.ts
Last active Dec 31, 2015
A way to override express' app.render function
View override-app-render.ts
app.use((req: express.Request, resp: express.Response, next?: Function) => {
var render = resp.render;
resp.render = (view: string, options?: any, fn?: any) => {
if ('function' == typeof options) {
fn = options;
options = {};
}, view, options, (err, html) => {
if (html) {
View create-hot-cold-observable.js
/*eslint-env jasmine*/
import Rx from 'rxjs';
fdescribe('TestScheduler', () => {
describe('createHotObservable()', () => {
it('should create a hot observable emmiting the values given as marble strings', () => {
const scheduler = new Rx.TestScheduler(null);
valotas / index.html
Last active May 15, 2017
View index.html
<!DOCTYPE html>
<link rel="stylesheet" href="">
<script src=""></script>
<script src=""></script>
<script src=""></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
valotas /
Created Sep 25, 2011
Get the output of an the web container as string
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
public class CharArrayWriterResponse extends HttpServletResponseWrapper {
private final CharArrayWriter charArray = new CharArrayWriter();
valotas / index.js
Last active Sep 18, 2017
download vscode vsix files
View index.js
const { JSDOM } = require("jsdom");
const semver = require("semver");
const Listr = require("listr");
const { Observable } = require("rxjs");
const http = require("https");
const fs = require("fs");
function fetchPluginInfo(plugin) {
return JSDOM.fromURL(
You can’t perform that action at this time.