Skip to content

Instantly share code, notes, and snippets.

View tene's full-sized avatar

Stephen Weeks tene

  • Sunnyvale, CA
View GitHub Profile
#!/usr/bin/perl
use strict;
use v5.10.0;
use List::Util qw/shuffle/;
use Data::Dumper;
use lib '/home/sweeks/perl5';
use Perlin qw/noise/;
#system('tput clear');
...# ############.....................#######.# ####......### ##...........................## ######### ########.....##########..............# ########.....##############
..## ########......................#############......#### ###.......#######...............##### ###....########.............### ##.....## #
.## ##..............................................### ##.........### #######.............###### ##......##................## ###....### #
## ##.............................................### ###............#### ###................## ##........................## ###....## #
## #..........................#..................## ###.................########...................# ###..........................### ##....#### #
.### #......####................###.................##
macro my-if($/)
is parsed(
rule {
<cond=EXPR> <iftrue=block>
['else' <iffalse=block>]?
} ) {
quasi {
{{{$<cond>.ast}}}
?? {{{$<iftrue>.ast}}}
!! {{{$<iffalse>.ast}}}
#!/usr/bin/perl
sub magic_test_shit {
use Test::More;
plan tests => 5;
is(1,1,"O HAI");
}
print "lololol\n";
Stats are:
limbs, muscle, eyes, organs, physical knowledge, practical knowledge,
social knowledge, scholarly knowledge
-----------------------------------------------------------
Most skill formulas are a sum of multipliers of stats and skill level. For example:
First Aid: Limbs x 0.5 + Practical x 2 + Skill x 5
This can be represented by a db table that has a column for each stat, and one for the skill level
int main(int argc, char **argv) {
uid_t *ruid = alloca(sizeof (uid_t));
uid_t *euid = alloca(sizeof (uid_t));
uid_t *suid = alloca(sizeof (uid_t));
getresuid(ruid, euid, suid);
printf("%d, %d, %d\n", *ruid, *euid, *suid);
}
[root@station2 ~]# mkdir /foo
[root@station2 ~]# auditctl -w /foo -p wa -k foo
[root@station2 ~]# touch /foo/file1
[root@station2 ~]# mkdir /foo/dir1
[root@station2 ~]# touch /foo/dir1/file2
[root@station2 ~]# rm /foo/dir1/file2
[root@station2 ~]# ausearch -k foo
----
time->Tue Jan 12 14:22:18 2010
type=CONFIG_CHANGE msg=audit(1263331338.735:26): auid=0 subj=root:system_r:auditctl_t:s0-s0:c0.c1023 op=add rule key="foo" list=4 res=1
[sweeks@kweh exp-fuse]$ getfattr -d repo/*
# file: repo/concurrent_gc.txt
user.lol.tags="programming,parrot"
# file: repo/define-syntax-primer.txt
user.lol.tags="programming,scheme"
# file: repo/feynman.txt
user.lol.tags="reading,physics"
#0 0x00000032d884ddcf in glClearColor () from /usr/lib64/libGL.so.1
#1 0x0000000000454f45 in love::graphics::opengl::w_setBackgroundColor (
L=0x76e430) at modules/graphics/opengl/wrap_Graphics.cpp:309
#2 0x000000379840c5a1 in ?? () from /usr/lib64/liblua-5.1.so
#3 0x0000003798417229 in ?? () from /usr/lib64/liblua-5.1.so
#4 0x000000379840ca6d in ?? () from /usr/lib64/liblua-5.1.so
#5 0x000000379840c107 in ?? () from /usr/lib64/liblua-5.1.so
#6 0x000000379840c182 in ?? () from /usr/lib64/liblua-5.1.so
#7 0x0000003798407b61 in lua_pcall () from /usr/lib64/liblua-5.1.so
#8 0x000000379841994c in ?? () from /usr/lib64/liblua-5.1.so
grammar Question::Grammar {
rule TOP {
<question>+
{*}
}
token question {
<header>
<answer>+
{*}
}