Skip to content

Instantly share code, notes, and snippets.

View dalinaum's full-sized avatar
:octocat:
Learning Rust and IR.

LYK dalinaum

:octocat:
Learning Rust and IR.
View GitHub Profile
@dalinaum
dalinaum / gist:726580
Created December 3, 2010 04:27
perl 6 oop
class Person {
# $. means "public", "is rw" means it is writable.
has ($.position, $.succ is rw);
has $.alive is rw = True;
# Stringify
method Str() {
"Person $.position, " ~ ($.alive ?? "alive" !! "dead")
}
# Create a linked chain of people.
class Person
# Accessor and mutator methods
attr_reader :position, :succ, :alive
attr_writer :position, :succ, :alive
# Initialize
def initialize(pos)
@position = pos
@alive = true
end
<sanxiyn> However, we need a lot more from the ROK, especially
<sanxiyn> financial support for the Afghan Army, for which we have
<sanxiyn> requested USD 100 million a year for five years, which is the
<sanxiyn> USG primary request of the ROK.
<sanxiyn> 09SEOUL1241
#!/usr/bin/env perl
use utf8;
use strict;
use warnings;
use WWW::Mechanize;
binmode STDOUT, ':encoding(UTF-8)';
use constant {
PROGRAMMING_GALLERY => 'http://gall.dcinside.com/list.php?id=programming',
grammar URL {
token TOP {
<schema> '://'
[<ip> | <hostname> ]
[ ':' <port>]?
'/' <path>?
}
token byte {
(\d**{1..3}) <?{ $0 < 256 }>
}
if [[ -f $HOME/.perlbrew/init ]]; then
source $HOME/.perlbrew/init
fi
__perlbrew_reinit () {
echo '# DO NOT EDIT THIS FILE' > $HOME/.perlbrew/init
command perlbrew env $1 >> $HOME/.perlbrew/init
source $HOME/.perlbrew/init
__perlbrew_set_path
}
@dalinaum
dalinaum / af.fd
Created March 18, 2011 11:49
nice
asdf
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use File::Find;
die "arguments: <temp project file> <result.xml>" if @ARGV != 2;
my $temp_file = $ARGV[0];
open my $rule, '>', $temp_file;
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use File::Find;
die "arguments: <temp project file> <result.xml>" if @ARGV != 2;
my $temp_file = $ARGV[0];
open my $rule, '>', $temp_file;
<Model::CollectionOfRepos>
# This is set so that if you run Gitalist out of a git checkout then you
# can browse the repositories the directory level above your checkout.
# This file is suppressed from the built dist by MANIFEST.SKIP, so you
# don't have this config if you install from CPAN.
# repo_dir __path_to(../)__
#repo_dir /srv/gitosis/git/
repos /srv/gitosis/git/bloader.git
repos /srv/gitosis/git/kernel.git
repos /srv/gitosis/git/uandroid.git