Skip to content

Instantly share code, notes, and snippets.

View treyharris's full-sized avatar

Trey Harris treyharris

View GitHub Profile
(defcustom my-read-only-file-list '()
"Filenames or patterns that will be opened read-only."
:group 'my-customizations
:type '(repeat string)
)
;; This defun works if called via:
;; M-: (my-read-only-files)<RET>
;; it sets the buffer read-only iff the file is in my-read-only-file-list
;; but as of Emacs 26, it no longer happens after helm-find-file.
===SORRY!=== Error while compiling /home/trey/src/rakudo/t/spec/S12-traits/parameterized.t
Cannot add tokens of category 'trait_auxiliary'
at /home/trey/src/rakudo/t/spec/S12-traits/parameterized.t:18
------>  multi sub trait_auxiliary:<is>⏏(cool $trait, Any $container; $val) { 
S12-traits/parameterized.t ..
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
Test Summary Report
-------------------
@treyharris
treyharris / -
Created January 29, 2020 20:43
S12-traits/parameterized.t ..
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
Test Summary Report
-------------------
S12-traits/parameterized.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
Files=1, Tests=0, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.20 cusr 0.03 csys = 0.24 CPU)
#!/usr/bin/env perl6
proto check_type($ --> Str) { * }
multi check_type(uint $var) { return "uint" }
multi check_type(Int $var) { return "Int" }
my uint $ui = 42;
say "Value is $ui"; # Value is 42
say check_type($ui); # uint

Some long lines

This is some text that will use very long lines that exceed a width you might expect. Sit nemo adipisci odio. Quia pariatur exercitationem non iure fugit unde architecto et. Aut qui accusamus itaque ea deleniti. Quae libero consequatur aut eum rerum repudiandae. Libero recusandae repellat cupiditate commodi vitae facilis qui eum. Eos itaque non animi mollitia voluptates odio maxime. Aliquid quaerat ad dolores in provident est et.

Here is a long link.

Some long lines

This is some text that will use very long lines that exceed a width you might expect. Sit nemo adipisci odio. Quia pariatur exercitationem non iure fugit unde architecto et. Aut qui accusamus itaque ea deleniti. Quae libero consequatur aut eum rerum repudiandae. Libero recusandae repellat cupiditate commodi vitae facilis qui eum. Eos itaque non animi mollitia voluptates odio maxime. Aliquid quaerat ad dolores in provident est et.

Here is a long link.

y = 3
x = y # x assigned value of y
y = 4
print(x) # Result: 3
y = 3
x := y # x bound to y
y = 4
print(x) # Result: 4
# -*-shell-script-*-
# Often we want to search for a specific subsection in a manpage. This
# script does that by searching the manpage for a line that begins
# with the pattern (after accounting for whitespace).
#
# If PCRE support is compiled into less, we right-delimit the search
# pattern with the word-boundary anchor \b, since flag and subcomment
# sections often are bounded by other characters (like "-n=<num>").
# Otherwise we right-delimit with the space, equals sign, or left bracket.
#
;; Already defined elsewhere, but including in this Gist for context
(defgroup my-customizations nil
"Custom variables introduces in the user init file."
)
(defcustom my-read-only-file-list '()
"Filenames or patterns that will be opened read-only."
:group 'my-customizations
:type '(repeat string)
)