Skip to content

Instantly share code, notes, and snippets.

View natarius's full-sized avatar

Matthias natarius

View GitHub Profile
@daffl
daffl / uglify.js
Last active March 17, 2021 20:09
Use UglifyJS 2 (uglify-js package) to compress a string of JavaScript source code
var UglifyJS = require('uglify-js');
module.exports = function(code) {
var toplevel = UglifyJS.parse(code);
toplevel.figure_out_scope();
var compressor = UglifyJS.Compressor({
warnings: false
});
@natarius
natarius / email_crawler.rb
Last active December 13, 2015 17:38
Crawl email addresses from a site including recursive following all links on that domain.
class EmailCrawler
require 'rubygems'
require 'mechanize'
require 'parallel'
attr_accessor :links, :crawl_host, :parsed_sites
def crawl(url)
@links = Array.new
@parsed_sites = Array.new
@jwang
jwang / schema.xml
Created September 5, 2011 23:17
solr schema for fuzzy and file search
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0