-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Track the codefigs things. Will likely be removed from tracking
in the future.
- Loading branch information
Showing
7 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
defines: | ||
- define_new: example_set | ||
y_type: CommandSequence | ||
examples: | ||
- x: | ||
- make a copy of [-[FILENAME]-] in parent dir | ||
- copy [-[FILENAME]-] to parent directory | ||
- copy [-[FILENAME]-] up one directory | ||
y: | ||
- cp [-[FILENAME]-] .. | ||
- x: | ||
- copy [-[1=DIRNAME]-] to [-[2=DIRNAME]-] | ||
- recursive copy [-[1=DIRNAME]-] to [-[2=DIRNAME]-] | ||
- cp for directories [-[1=DIRNAME]-] [-[2=DIRNAME]-] | ||
y: | ||
- cp -r [-[$1]-] [-[$2]-] | ||
- x: | ||
- copy everything in [-[1=ENGWORD]-] dir to [-[$1]-]copy | ||
y: | ||
- cp -r [-[$1]-]/* [-[$1]-]copy | ||
# ...Other examples ommitted for conciseness............................. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
defines: | ||
- define_new: example_set | ||
y_type: CommandSequence | ||
examples: | ||
- x: | ||
- list files here with smallest file first | ||
- display files smallest to largest | ||
- list files small to big | ||
- show files. Sort by file size small first | ||
y: | ||
- ls -lSr | ||
- ls -Sr | ||
# ...Other examples ommitted for conciseness............................. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
defines: | ||
- define_new: type | ||
name: Number | ||
- define_new: object | ||
name: decimal_number | ||
type: Number | ||
children: | ||
- name: SignArg | ||
type: Sign | ||
required: False | ||
- name: BeforeDecimal | ||
type: IntBase | ||
required: True | ||
- name: AfterDecimal | ||
type: IntBase | ||
required: False | ||
- name: Exponent | ||
type: IntBase | ||
required: False | ||
preferred_object_parser: | ||
grammar: | | ||
SignArg? BeforeDecimal ("." AfterDecimal)? ("e" Exponent)? | ||
# Definition of Sign type and IntBase type omitted .......................... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
defines: | ||
- define_new: object | ||
name: wc | ||
type: Program | ||
# We must provide type data so the default TypeParser for Programs knows | ||
# how to recognize this object in strings. | ||
type_data: {invoke_name: "wc"} | ||
children: | ||
- name: l | ||
arg_data: {short_name: "l", long_name: "lines"} | ||
- name: c | ||
# By default arguments are optional. | ||
# We can also explicitly specify this for clarity. | ||
required: False | ||
# The default ObjectParser for Program's knows how to parse | ||
# POSIX-compliant program argument conventions. To do this the parser | ||
# examines the arg_data that the user provides for the arguments. | ||
arg_data: {short_name: "c", long_name: "bytes"} | ||
- name: m | ||
arg_data: {short_name: "m", long_name: "chars"} | ||
- name: w | ||
arg_data: {short_name: "w", long_name: "words"} | ||
- name: files_list | ||
# The previous arguments had None type (were just flags) | ||
# However, this positional argument has a Type which needs to be parsed | ||
type: PathList | ||
arg_data: {position: 0, multiword_pos_arg: True} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
defines: | ||
- define_new: example_set | ||
# All example_set definitions must include a root y_type. For Unix commands, | ||
# the root type is CommandSequence. However, this framework could also be | ||
# used with a root type of RegularExp, SQL, or something else more domain | ||
# specific. This allows AInix to be used in multitask settings. | ||
y_type: CommandSequence | ||
examples: | ||
- x: | ||
- how many lines are in [-[FILENAME]-] | ||
- Counts lines of [-[FILENAME]-] | ||
- line count of [-[FILENAME]-] | ||
- get line count of [-[FILENAME]-] | ||
y: | ||
- wc -l [-[FILENAME]-] | ||
risk: 0 | ||
- x: | ||
- how many words are in [-[FILENAME]-] | ||
- get the word count of [-[FILENAME]-] | ||
- word count [-[FILENAME]-] | ||
y: | ||
- wc -w [-[FILENAME]-] | ||
risk: 0 | ||
- x: | ||
- how many letters are in "[-[ENGWORD]-]" | ||
y: | ||
- echo "[-[ENGWORD]-]" | wc -c | ||
risk: 0 | ||
# ...Examples ommitted for conciseness... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
for file in $(ls *.yaml) | ||
do | ||
echo ${file} | ||
pygmentize -f png -O style=lovelace,font_size=30 ${file} > ${file}.png | ||
done |