Skip to content

Instantly share code, notes, and snippets.

View hideo55's full-sized avatar

Hideaki Ohno hideo55

View GitHub Profile
@hideo55
hideo55 / v8_regexp_cache.js
Created December 23, 2011 03:14
V8 Engine cached target string of pattern match.
var assert = function(expr, msg){
var message = 'Assertion failed';
if(msg) message += ': ' + msg;
if(!expr) throw new Error(message);
};
var matchResultA;
(function(){
var A = RegExp('.');
@hideo55
hideo55 / uxmap_sample.cc
Created December 14, 2011 14:21
sample code of ux::Map
#include <map>
#include <string>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <ux/ux.hpp>
using namespace std;
int main(int argc, char** argv){
#!/bin/sh
NODE_VERSIONS=("v0.4.12" "v0.6.5")
VERSION_MANAGER="/usr/local/bin/nodebrew use"
for val in ${NODE_VERSIONS[@]}
do
$VERSION_MANAGER $val
npm run-script install
npm run-script test
@hideo55
hideo55 / jsmeterCMD.js
Created November 15, 2011 16:17
jsmeter command script
#!/usr/bin/env node
(function() {
var verbose = false;
var args = process.argv;
var fs = require("fs");
var jsmeter = require("jsmeter").jsmeter;
for(var a = 2; a < args.length; a++) {
if(args[a] === "--verbose") {
verbose = true;
@hideo55
hideo55 / google_reader_style.css
Created November 1, 2011 15:20
Google Reader StyleSheet for Stylist
#logo-container, #search-submit, /*#chrome-lhn-menu,*/ #viewer-footer, #mark-#viewer-refresh, #item-up-down-buttons, #search div[class="goog-inline-block jfk-button jfk-button-action"] {
display: none !important;
}
#gb, #top-bar {
visibility: collapse !important;
height: 0px !important;
border: none !important;
}
#gbg {
z-index: 20010 !important;
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Docca;
use Data::Section::Simple qw/get_data_section/;
my $docca = Docca->new(
from => { Xatena => { converter => { hatena_compatible => 1 }, }, },
to => { PDF => { bin_name => '/usr/local/bin/wkhtmltopdf', }, },
@hideo55
hideo55 / gist:1253830
Created September 30, 2011 14:02
ヴィジュアルモードの選択範囲に対してコマンドを実行
"選択範囲に対してperltidyを実行する例ですが、
noremap <buffer> ,ptv <Esc>:'<,'>! perltidy -pbp<CR>
"こんな感じでいけます。'<,'>がヴィジュアルモードでの選択範囲を表してます
"選択して ,ptv とタイプすると選択範囲が perltidy -pbp に渡され、選択範囲がperltidyの標準出力で置換されます
- var html='<script type="text/javascript" src="http****?hoge=fuga&foo=bar"><script>'
| !{html}
@hideo55
hideo55 / build.log
Created September 2, 2011 16:55
build.log of cpanm on the dotcloud
Checking if you have Pickles 0 ... No
==> Found dependencies: Pickles
Searching Pickles on cpanmetadb ...
--> Working on Pickles
Fetching http://search.cpan.org/CPAN/authors/id/D/DM/DMAKI/Pickles-0.08.tar.gz
-> OK
Unpacking Pickles-0.08.tar.gz
Entering Pickles-0.08
Checking configure dependencies from META.yml
Checking if you have ExtUtils::MakeMaker 6.42 ... Yes (6.56)
#!/usr/bin/env perl -w
use strict;
use Text::Xslate;
use AnyEvent::JSONRPC::Lite::Server;
use Getopt::Long;
my ( $port, $template_path );
GetOptions( "port=i" => ¥$port, "path=s" => ¥$template_path );