View chuncks.js
Object.defineProperty(Array.prototype, 'chunk', {
value: function(chunkSize) {
var R = [];
for (var i=0; i<this.length; i+=chunkSize)
R.push(this.slice(i,i+chunkSize));
return R;
}
});
Array.range(10).chunk(3);
View beetle
#!/usr/bin/env ruby
require "csv"
require "net/http"
require "date"
require "json"
#
# Get log data
#
View Mamutinho.java
package br.com.mamutelanoso;
import java.io.IOException;
import java.util.Properties;
import javax.mail.BodyPart;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
View xsp4-stop.sh
kill `ps aux | grep xsp4.exe | grep -v grep | awk '{print $2}'`
View .gitignore
.DS_Store
*.dll
*.exe
View ErrorLogger.cs
using System;
using System.Collections.Generic;
namespace TaskParallelization
{
class ErrorLogger
{
private readonly IList<string> _messages;
public ErrorLogger()
View .gitignore
.DS_Store
*.dll
*.xml
View .gitignore
.DS_Store
*.exe
View klogd.py
# ==========================
# Getting Started with klogd
# ==========================
#
# Klogd is a dumb script to stream Syslog messages to a Kafka server.
#
# 1) Make sure you have all dependencies installed properly
#
# - Twisted
# - PyParsing
View README
$ python xlogd.py sample.log
parsed: {'appname': 'test.app', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '68898', 'priority': '132', 'message': 'bla bla bla warn'}
parsed: {'appname': 'test.app', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '68902', 'priority': '131', 'message': 'bla bla bla error'}
parsed: {'appname': 'Dock', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '154', 'priority': '11', 'message': 'CGSReleaseWindowList: called with 5 invalid window(s)'}
parsed: {'appname': 'WindowServer', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '79', 'priority': '11', 'message': 'CGXSetWindowListAlpha: Invalid window 0'}