Skip to content

Instantly share code, notes, and snippets.

@ysasaki
ysasaki / handler.clj
Last active August 29, 2015 14:02
compojure + httpkitのhello, worldのbenchmark
yosasaki@SPC-072 devel% boom -n 10000 -c 200 http://localhost:5000/
10000 / 10000 Boooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! 100.00 %
Summary:
Total: 0.5068 secs.
Slowest: 0.0462 secs.
Fastest: 0.0033 secs.
Average: 0.0099 secs.
Requests/sec: 19732.5997
Total Data Received: 110000 bytes.
@ysasaki
ysasaki / build.log
Created April 2, 2014 17:39
Finish installing hhvm
% sudo brew install hhvm --HEAD Password:
==> Cloning https://github.com/facebook/hhvm.git
Updating /Library/Caches/Homebrew/hhvm--git
==> Patching
patching file hphp/runtime/ext/gd/libgd/gdft.cpp
patching file CMake/HPHPFindLibs.cmake
patch unexpectedly ends in middle of line
Hunk #1 succeeded at 29 with fuzz 2 (offset 2 lines).
==> cmake . -DCMAKE_CXX_COMPILER=/usr/local/opt/gcc48/bin/g++-4.8 -DCMAKE_C_COMPILER=/usr/local/opt/gcc48/bin/gcc-4.8 -DCMAKE_ASM_COMPILER=/usr/local/opt/gcc48/bin/gcc-4
==> make -j4
@ysasaki
ysasaki / buid-error.log
Created April 1, 2014 14:52
hhvm build error on Mac OSX 10.9
% cmake . \ (git)-[master] -
-DCMAKE_CXX_COMPILER=$(brew --prefix gcc48)/bin/g++-4.8 \
-DCMAKE_C_COMPILER=$(brew --prefix gcc48)/bin/gcc-4.8 \
-DCMAKE_ASM_COMPILER=$(brew --prefix gcc48)/bin/gcc-4.8 \
-DLIBIBERTY_LIB=$(brew --prefix gcc48)/lib/x86_64/libiberty-4.8.a \
-DCMAKE_INCLUDE_PATH="/usr/local/include:/usr/include" \
-DCMAKE_LIBRARY_PATH="/usr/local/lib:/usr/lib" \
-DLIBEVENT_LIB=$(brew --prefix libeventfb)/lib/libevent.dylib \
-DLIBEVENT_INCLUDE_DIR=$(brew --prefix libeventfb)/include \
-DICU_INCLUDE_DIR=$(brew --prefix icu4c)/include \
@ysasaki
ysasaki / httpd22.conf
Last active August 29, 2015 13:56
httpd 2.4.6でmod_access_compatを読み込んでいても403になる
# 動かない
<Directory "/hoge">
Order deny,allow
Deny from all
Allow from all
</Directory>
<?php
if (sizeof($argv)>1) {
class Foo
{
public static function hello()
{
echo "ue!!!\n";
}
}
@ysasaki
ysasaki / app.psgi
Last active December 23, 2015 14:49
use strict;
use warnings;
use Plack::Buidler;
use MyWAF::DSL qw(app get post);
app {
get '/index' => sub {
my $env = shift;
...
},
@ysasaki
ysasaki / MyBuilder.pm
Last active December 20, 2015 17:58
Minillaでsrc/hello.cをscript/helloにcompileしてinstallする感じのMyBuilder.pm
package builder::MyBuilder;
use strict;
use warnings;
use base qw(Module::Build);
use File::Spec;
sub new {
my ( $self, %args ) = @_;
$self->SUPER::new( %args, c_source => ['src'], );
}
@ysasaki
ysasaki / dashboard_controller.rb.patch
Created July 5, 2013 06:19
GitLab 5-3-stable DashboardのfeedにEventFilterを適用しないpatch
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index b74c22b..dd3e85d 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -12,7 +12,7 @@ class DashboardController < ApplicationController
@projects = @projects.limit(20)
@events = Event.in_projects(current_user.authorized_projects.pluck(:id))
- @events = @event_filter.apply_filter(@events)
+ @events = @event_filter.apply_filter(@events) if request.format != :atom
@ysasaki
ysasaki / bindtoroute53.pl.patch
Last active December 19, 2015 04:39
@に対応するためbindtoroute53.plに当てるuzulla patch。Licenseは多分uzullaさんにあります ref: http://uzulla.hateblo.jp/entry/2013/05/15/010328
--- a/bindtoroute53.pl 2013-07-01 14:48:27.000000000 +0900
+++ b/bindtoroute53.pl 2013-07-01 14:48:33.000000000 +0900
@@ -174,12 +174,16 @@
# name is empty string or @ without $ORIGIN
$name = $origin;
}
- if($name !~ /$origin\.?$/) {
- if($name =~ /\.$/ || $dig) {
- print STDERR "Ignoring '" . $zonerr->string . "', name must be part of zone.\n";
- next;
@ysasaki
ysasaki / build.sh
Last active December 18, 2015 16:39
JSON::PPがないって怒られるパターン
#!/bin/bash
carton install