Skip to content

Instantly share code, notes, and snippets.

View mix3's full-sized avatar

mix3@サタデーナイトフィーバー mix3

View GitHub Profile
@mix3
mix3 / crud.pl
Created April 23, 2011 15:51
Mojolicious::Lite+Teng+SNBinder(+SQLite/In-Memory)でCRUDアプリ
package Message;
use parent 'Teng';
__PACKAGE__->load_plugin('Pager');
use Class::Method::Modifiers;
around delete => sub {
my ($orig, $self, $table_name, $delete_condition) = @_;
my $update_row_data = {
deleted_at => DateTime->now->set_time_zone('Asia/Tokyo'),
@mix3
mix3 / xslate_crud.pl
Created April 23, 2011 17:09
Mojolicious::Lite + Teng + SNBinder + Xslate (+ SQLite/OnMemory)でCRUDアプリ
package Message;
use parent 'Teng';
__PACKAGE__->load_plugin('Pager');
use Class::Method::Modifiers;
around delete => sub {
my ($orig, $self, $table_name, $delete_condition) = @_;
my $update_row_data = {
deleted_at => DateTime->now->set_time_zone('Asia/Tokyo'),
@mix3
mix3 / ajax_crud.pl
Created April 23, 2011 18:19
Mojolicious::Lite + Teng + SNBinder + Xslate + ajax/jQuery (+ SQLite/OnMemory) でCRUDアプリ(未完)
package Message;
use parent 'Teng';
__PACKAGE__->load_plugin('Pager');
use Class::Method::Modifiers;
around delete => sub {
my ($orig, $self, $table_name, $delete_condition) = @_;
my $update_row_data = {
deleted_at => DateTime->now->set_time_zone('Asia/Tokyo'),
@mix3
mix3 / hadoop_const.md
Created April 27, 2011 13:38
Cloudera製Hadoopによる完全分散モードの構築

Cloudera製Hadoopによる完全分散モードの構築

構成

VirtualBox上に構築

namenode 1台
datanode 3台
  • ホストオンリーネットワーク
@mix3
mix3 / hadoop_perl.md
Created April 27, 2011 14:30
HadoopでMapReduceに挑戦

HadoopでMapReduceに挑戦

サンプル実行

円周率の計算

$ sudo -u mapred hadoop jar /usr/lib/hadoop/hadoop-examples.jar pi 1 1000

Number of Maps  = 1
Samples per Map = 1000

Wrote input for Map #0

@mix3
mix3 / Enqueue.pl
Created May 2, 2011 11:34
QudoでSCPによるログ回収してみるテスト
#!/usr/bin/env perl
use strict;
use warnings;
use Qudo;
use FindBin;
use YAML::Tiny;
my %argv;
@mix3
mix3 / all_in_one.pl
Created May 3, 2011 15:43
Mojolicious::Lite + Teng + SNBinder + Xslate (+ SQLite/OnMemory) でCRUDアプリ
package Message;
use parent 'Teng';
__PACKAGE__->load_plugin('Pager');
use Class::Method::Modifiers;
around delete => sub {
my ($orig, $self, $table_name, $delete_condition) = @_;
my $update_row_data = {
deleted_at => DateTime->now->set_time_zone('Asia/Tokyo'),
@mix3
mix3 / log_retrieve.sh
Created May 4, 2011 06:26
シェルクスリプトでログ回収
#!/bin/sh
BINPATH=$(cd $(dirname $0) && pwd)
FILE=$(basename $0)
FILEPATH=$BINPATH/$FILE
DATE=`date +"%Y%m%d"`
LOGPATH=/var/log/data-mining
ACCESSLOG=/access_log.$DATE
@mix3
mix3 / jquery.presentation.js.diff
Created June 10, 2011 22:08
diff -u js/jquery.presentation.js.orig js/jquery.presentation.js
--- js/jquery.presentation.js.orig 2010-05-23 23:18:18.000000000 +0900
+++ js/jquery.presentation.js 2011-06-11 04:13:06.000000000 +0900
@@ -33,6 +33,7 @@
* $.presentation.SlideManager
*/
$.presentation.SlideManager = function(){
+ this._fadetime = 500;
this._current = null;
this._items = [];
this._createItems();
@mix3
mix3 / Context.pm
Created June 21, 2011 15:42
MobaSiFをゴニョゴニョ
package Context;
use Any::Moose;
has stash => (
is => 'rw',
isa => 'HashRef',
lazy => 1,
default => sub { {} },
);