Skip to content

Instantly share code, notes, and snippets.

@mallowlabs
mallowlabs / _vimrc
Created March 6, 2013 02:19
my vimrc for Kaoriya Windows
" - Edit -
set tabstop=4 " tab width
set shiftwidth=4 " Number of spaces to use for each step of (auto)indent.
set expandtab " replace tab to spaces
set autoindent " auto indent
set paste " unable formatting in insert mode
set backspace=indent,eol,start " more powerful backspacing
set nobackup " do not make backup files
set nowritebackup " do not make backup files
set showmatch " heilight braces
@mallowlabs
mallowlabs / stoplight.php
Created November 29, 2012 00:25
Stoplight Provider for Nagios 2
<?php
$lines = file("/var/log/nagios/status.dat");
echo "{\n";
$processing_service = false;
$json = "";
$host_name = "";
$service_name = "";
@mallowlabs
mallowlabs / as-installer.sh
Created October 13, 2012 12:10
AsakusaSatellite installer for Heroku
#!/bin/sh
#
# AsakusaSatellite installer for Heroku Cedar
#
# codefirst.org
#
git clone git://github.com/codefirst/AsakusaSatellite.git
cd AsakusaSatellite
require 'sinatra'
require 'em-websocket'
require 'sinatra'
Thread.new do
EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 18082, :debug => true) do |connection|
connection.onopen { puts "connection" }
connection.onmessage { }
connection.onerror { |error| puts error }
connection.onclose { puts "close" }
@mallowlabs
mallowlabs / faster_redmine_code_review_plugin.patch
Created July 28, 2011 03:26
A patch for faster Redmine Code Review Plugin
diff --git assets/javascripts/code_review.js assets/javascripts/code_review.js
index cd94715..18f66b9 100644
--- assets/javascripts/code_review.js
+++ assets/javascripts/code_review.js
@@ -109,24 +109,26 @@ function setAddReviewButton(url, change_id, image_tag, is_readonly, is_diff, att
var filetables = [];
var j = 0;
var i = 0;
- for (i = 0; i < tables.length; i++) {
+ var tl = 0;
@mallowlabs
mallowlabs / javancss_patch_for_maven_site.diff
Created June 6, 2011 12:20
A patch for Jenkins JavaNCSS Plugin with "mvn site"
Index: src/main/java/hudson/plugins/javancss/JavaNCSSMavenPublisher.java
===================================================================
--- src/main/java/hudson/plugins/javancss/JavaNCSSMavenPublisher.java (revision 39313)
+++ src/main/java/hudson/plugins/javancss/JavaNCSSMavenPublisher.java (working copy)
@@ -47,8 +47,8 @@
private static final String PLUGIN_EXECUTE_GOAL = "report";
protected boolean isExecutingMojo(MojoInfo mojo) {
- return mojo.pluginName.matches(PLUGIN_GROUP_ID, PLUGIN_ARTIFACT_ID)
- && PLUGIN_EXECUTE_GOAL.equals(mojo.getGoal());
@mallowlabs
mallowlabs / tweet_categorizer.rb
Created March 20, 2011 06:28
TDDBC でペアプロした結果です
require 'rubygems'
require 'open-uri'
class TweetCategorizer
def categorize(tweet)
time, user, body = split(tweet)
statuses = []
statuses << "HashTag" if hashtag?(body)
statuses << "Reply" if reply?(body)
statuses << "Mention" if mention?(body)
/*
* Copyright (C) Sapid Project 2009-2010
*/
package org.sapid.mkjsxmodelweb;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.StringReader;
@mallowlabs
mallowlabs / jar_version.rb
Created February 13, 2010 09:10
Get compiled version of jar files.
#!/usr/bin/env ruby -Ku
require 'rubygems'
require 'zipruby'
version_map = {
45.3 => "J2SE 1.1",
46.0 => "J2SE 1.2",
47.0 => "J2SE 1.3",
48.0 => "J2SE 1.4",
set meta-flag on
set convert-meta off
set input-meta on
set output-meta on
"\033[3~": delete-char