Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env perl
use strict;
use warnings;
use Test::TCP;
use File::Temp;
use LWP::UserAgent;
use HTTP::Server::PSGI;
use Path::Class;
use Cwd;
・テスト
function peco-git-recent-branches () {
local selected_branch=$(git for-each-ref --format='%(refname)' --sort=-committerdate refs/heads | \
perl -pne 's{^refs/heads/}{}' | \
peco)
if [ -n "$selected_branch" ]; then
BUFFER="git checkout ${selected_branch}"
zle accept-line
fi
zle clear-screen
}
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Web::Query;
use Time::HiRes qw(sleep);
use Perl6::Say;
use LWP::UserAgent;
use URI;
@shibayu36
shibayu36 / Sample1.pm
Last active August 29, 2015 14:27
Testing constant import by Test::UsedModules
package Sample1;
use Exporter::Lite;
use constant HOGE => 'fuga';
our @EXPORT_OK = qw(HOGE);
1;
class FakeStorage implements Storage {
length: number;
[key: string]: any;
[index: number]: string;
constructor() {
this.length = 0;
}
getItem(key: string): any {
class UserRegistrationsController < ApplicationController
def new
@user_registration_form = UserRegistrationForm.new
end
def create
@user_registration_form = UserRegistrationForm.new(user_registration_form_params)
if @user_registration_form.save
sign_in(@user_registration_form.user)