Skip to content

Instantly share code, notes, and snippets.

@neguse
neguse / json.go
Last active August 29, 2015 14:05
composite literal( https://golang.org/ref/spec#Composite_literals ) で入れ子になっているanonymous structをリテラルとして書きたかった
package main
import (
"encoding/json"
"fmt"
)
type Struct struct {
Inner struct {
Value string
@neguse
neguse / h.pl
Last active August 29, 2015 14:00
動かない原因がわからない
use h1;
use h2;
use Data::Dumper;
print "h1::\n" . Dumper \%h1::;
print "h2::\n" . Dumper \%h2::;
h1sub1;
h2sub1;
@neguse
neguse / LICENSE
Last active August 29, 2015 13:56
GYP( https://code.google.com/p/gyp/ )にglobでのパターンマッチを入れてみた。未テスト。
Copyright (c) 2009 Google Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
@neguse
neguse / gist:7714835
Created November 30, 2013 02:57
Nifty Cloudのsmall2でCentOS 6.4のインスタンスたててUnixBenchまわしてみました。
========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)
System: localhost.localdomain: GNU/Linux
OS: GNU/Linux -- 2.6.32-358.el6.x86_64 -- #1 SMP Fri Feb 22 00:31:26 UTC 2013
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz (5800.0 bogomips)
x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
11:25:00 up 8 min, 1 user, load average: 0.03, 0.08, 0.02; runlevel 3
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use enum qw(Normal Fight Flying Poison Ground Rock Bug Ghost Steel Fire Water Grass Electr Psychc Ice Dragon Dark Fairy Max);
use enum qw(S D H N); # Single, Double, Half, Nothing
my $type_chart = [