Skip to content

Instantly share code, notes, and snippets.

View aereal's full-sized avatar

aereal aereal

View GitHub Profile
use strict;
use warnings;
use Test::More;
use HTML::TreeBuilder::Select;
subtest 'class attribute with LF' => sub {
my $doc = <<EOS;
<div class="
my-class
git log --format="%aN <%aE>" | sort -u
# aereal <aereal@aereal.org>
# aereal <aereal@users.noreply.github.com>
echo "AOKI,Hanae <aereal@aereal.org>" > .mailmap
git log --format="%aN <%aE>" | sort -u
# AOKI,Hanae <aereal@aereal.org>
# aereal <aereal@users.noreply.github.com>
echo "aereal <aereal@aereal.org> aereal <aereal@users.noreply.github.com>" > .mailmap
git log --format="%aN <%aE>" | sort -u
  • Elasticsearch にはてなブログのエントリをインデックスさせる
  • 本文を kuromoji でアナライズする
  • はてなスター取得 API からスターの情報を取得するバッチ
  • はてなスターの情報をインデックスに追加する
function numerize(numeric) {
return Number(numeric.trim().replace(/,\s*/, ''));
}
function getNetTotal() {
var contents = document.getElementById('contents');
var totalTable = contents.querySelector('table:last-child');
var total = totalTable.querySelector('tr:last-child td:last-child').textContent;
return numerize(total);
}
#!/usr/bin/env ruby
require 'optparse'
require 'logger'
HISTORY_PATTERN = /\A: (?<started>\d+):(?<finished>\d+);(?<text>.+)\z/o.freeze
IGNORE_ENTRY_PATTERN = /\A(?:l[sla]?|man|git st\z)/o.freeze
REQUIRED_OPTION_NAMES = [:output_file, :input_file, :lines_to_read]
Config = Struct.new(:output_file, :input_file, :lines_to_read).new
var path = require('path');
var gulp = require('gulp');
var data = require('gulp-data');
var handlebars = require('gulp-compile-handlebars');
var rename = require('gulp-rename');
gulp.task('default', ['html']);
gulp.task('html', function () {
@aereal
aereal / 01_create_deployment.json
Created January 15, 2015 11:12
Deployment API response example
{
"url": "https://api.github.com/repos/aereal/playground-github-api/deployments/134168",
"id": 134168,
"sha": "6c16e9486fdf924365856aa906468598c96adc8a",
"ref": "0001_feature",
"task": "deploy",
"payload": {
},
"environment": "production",
let s:name = 'aereal'
function! s:hello()
let name = 'someone'
endfunction
call s:hello()
echo s:name
let paths = [
\ '/Users/aereal/repo/lib',
\ '/Users/aereal/repo/extlib',
\ '/Users/aereal/repo/local/lib/perl5',
\ '/Users/aereal/repo/local/lib/perl5/darwin-2level',
\ '/Users/aereal/repo/t/lib',
\ '/Users/aereal/repo/lib',
\ '/Users/aereal/repo/extlib',
\ '/Users/aereal/repo/local/lib/perl5',
\ '/Users/aereal/repo/local/lib/perl5/darwin-2level',
@aereal
aereal / usage.t
Last active August 29, 2015 14:14
use IPC::Run ();
use List::Util qw(reduce);
sub run {
my (@cmd) = @_;
my $success = IPC::Run::run(\@cmd, \undef, \my $stdout, \my $stderr);
return +{
cmd => \@cmd,
success => $success,