Skip to content

Instantly share code, notes, and snippets.

@hitode909
hitode909 / Immurable.pm
Created September 20, 2016 07:24
->cloneを持つクラス用のImmutableクラス
use strict;
use warnings;
use URI;
use DateTime;
use Test::More;
package Immutable {
sub new {
my ($class, $obj) = @_;
bless {
gem "urls", git: "https://gist.github.com/8e3fde72960e9adbbc7b5cbf4e0d5861.git"
@hitode909
hitode909 / urls
Last active May 27, 2016 00:19
Extract and print the URLs
require 'uri'
while line = gets
begin
URI.extract(line, ['http', 'https']).each do |uri|
puts uri
end
rescue
end
end
@hitode909
hitode909 / hubot-lgtm-registerable.coffee
Created March 2, 2016 07:56
Registerable Hubot LGTM Command
# Description:
# LGTM
#
# Commands:
# hubot LGTM - LGTM
# hubot lgtm register <URL> - register a new LGTM
BRAIN_KEY = 'lgtm'
module.exports = (robot) ->
@hitode909
hitode909 / aliases.txt
Created January 21, 2016 05:56
1文字エイリアスを集める
% for char in {a-z}; do; which $char; done;
a not found
b not found
c not found
d not found
e () {
emacsclient -n ${*:-.} 2> /dev/null || open -a /Applications/Emacs.app ${*:-.}
}
f () {
cd $__session_from
@hitode909
hitode909 / p.plantuml
Last active October 12, 2015 09:22
Output example of package2plantumlclassdiagram
@startuml
class HTTP::Message::PSGI {
{static} new($content, $chunked)
+ req_to_psgi()
+ res_from_psgi($psgi_res)
+ HTTP::Request::to_psgi()
+ HTTP::Response::from_psgi()
+ read()
+ close()
- _res_from_psgi($status, $headers, $body)
@hitode909
hitode909 / a.css
Created April 12, 2015 09:05
左端は丸くしない
body {
border-radius: 0px !important;
}
@hitode909
hitode909 / gist:7da7d4dad43c6fb94407
Created April 8, 2015 03:41
トリミングしてアスペクト比を1.3くらいにする
% convert -trim sozai-big.png sozai-trim.png
% identify sozai-trim.png
sozai-trim.png PNG 2385x2885 2834x3000+286+115 8-bit sRGB 3.756MB 0.000u 0:00.000
% convert -resize 2300x3000 -gravity south -background white -extent 2300x3000 sozai-trim.png onigiri.jpg
#!/bin/bash
echo -n !
exec git "$@"
@hitode909
hitode909 / max.txt
Created January 14, 2015 11:44
マックス
BSアニマックス
COMIC_モエマックス
Dr.ハマックス
G1クライマックス
SBカプマックス
いきなり!クライマックス
いきなりクライマックス
いすゞユーマックス
かえるくんとマックス
はしだのりひことクライマックス