Skip to content

Instantly share code, notes, and snippets.

@dha
dha / gist:409794ce0679da81507eaf2602d39374
Created May 23, 2016 22:32
Suggestion for adding :ww documentation to qw and qqw docs.
Under qw (extension of existing paragraph):
The C<:w> form, usually written C«<…>» or C<qw>, splits the string into
"words". In this context, words are defined as sequences of non-whitespace
characters separated by whitespace. The C<q:w> and C<qw> forms inherit the
interpolation and escape semantics of the C<q> and single quote string
delimiters, whereas C<Qw> and C<Q:w> inherit the non-escaping semantics of
the C<Q> quoter. Note that C<:w> will preserve any quote characters in the text. I. e.
C<qw/'hello world'/> will return "'hello" and "world'". If you want the quotes
removed, use the C:ww> adverb: C<qww>.
=begin pod
=head2 routine split
Definded as:
multi sub split( Str:D $delimiter, Str:D $input, $limit = Inf, :$all) returns Positional
multi sub split(Regex:D $delimiter, Str:D $input, $limit = Inf, :$all) returns Positional
multi method split(Str:D $input: Str:D $delimiter, $limit = Inf, :$all) returns Positional
multi method split(Str:D $input: Regex:D $delimiter, $limit = Inf, :$all) returns Positional
@dha
dha / lc.pod
Created September 28, 2015 18:42
Example for proposed template for Perl 6 docs
=begin pod
=head2 routine lc
Defined as:
multi sub lc(Str:D ) returns Str:D
multi method lc(Str:D:) returns Str:D
Usage:
@dha
dha / whileuntil.txt
Created September 15, 2015 21:40
Proposed Perl 6 while/until documentation. Also planning to place this *above* repeat/while and repeat/until
=begin pod
=comment TODO Add docs about LABELs
The C<while> statement executes the block as long as its condition is
true. So
=begin code
my $x = 1;
@dha
dha / state.txt
Last active September 15, 2015 18:24
Proposed documentation for C<state>
=begin pod
C<state> declares lexically scoped variables, just like C<my>. However,
initialization happens exactly once the first time the initialization
is encountered in the normal flow of execution. Thus, state variables
will retain their value across multiple executions of the enclosing
block or routine.
Therefore, the subroutine
@dha
dha / for.txt
Last active September 10, 2015 20:45
Suggested documentation for C<for> in Perl 6
=head2 for
The C<for> loop iterates over a list.
=begin code
for @foo {.print}
=end code
@dha
dha / state.txt
Created September 8, 2015 17:16
documenatation for C<state>
This is the documentation for C<state> from Perl 5.
Is it inaccurate or incomplete for C<state> in Perl 6? If not, can we slot it into variables.pod?
"state" declares a lexically scoped variable, just like "my".
However, those variables will never be reinitialized, contrary to
lexical variables that are reinitialized each time their enclosing
block is entered. See "Persistent Private Variables" in perlsub
for details.
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# By default this script does nothing.
@dha
dha / gist:17e2726a667673f51094
Created July 8, 2014 23:51
Results of attempting to use Tontec 2.8 screen with Raspberry Pi
If tontec plugged in on boot, immediately gives 'sh: can't access tty: job control turned off' and a "/ #" prompt.
If tontec plugged not plugged in, boot gets to "Initializing TFT Screen" and seems to hang there. Can ssh into the RP at this point.
Plugging tontec in at this point does not produce an image on the tontec. However, Button 4 on the tontec *does* reboot the RP.
Plugging the tontec in after we get to the bootloader but before actual boot screen produces the same effect.
For what it's worth, plugging the tontec in backwards (not that there's any indication of which way to plug it in) - i.e. with the pins in the wrong direction, seems to cut the power to the RP.