linustorvalds

Trying to help with democracy, see https://github.com/gregoryc/democracy (No affiliation with Linus Torvalds)


Keywords
ai, empowerment, agi, agis
License
BSD-2-Clause
Install
pip install linustorvalds==1.0.24

Documentation

                  Practical self-empowerment utilities  
                      covering every facet of life  

These tools are for everyone

It doesn't matter what political ideology you favor, these tools are all still
very valuable. You can live in Canada, the US, Russia, China or Africa, it
doesn't matter.

I intend to make people more able.
__________________________________________________________________

This lists all of the programs. Youtube channel here Democracy
YouTube Channel (youtube.com/gregorycohen1) and
facebook.com/democracygregoryc

                     Most important software here:  

Music program (Crystal and Ruby), see fix_the_society folder

Ultimate chat app (Win, Lin, CLI)

Discourse Generator Program vesion 1 and version 2 (node, ruby, browser
(kind of like Siri); and C++ STL)

And Semantic metadata project

And “Emerald C” (the “Best Programming Language”)

There is also a desktop widget for that site, and old random sentence
generator (useless) and an old compiler for my own programming
language. Those aside, there are these 91 programs

All of these programs are mostly self-contained. This is a really good thing.

                        Few or no dependencies!  

My email is gregorycohen2@gmail.com and I really would like to make
open source software. Everything I have is BSD licensed.
If this software gets you a job or makes you money or improves your
life or makes things easier for you, please consider donating. I have
released this software under the BSD license (a very liberal license)
for everyone to use and modify. I would appreciate it greatly if some
people could return the favor :)

Democracy gem github Ruby Gem
__________________________________________________________________

       Without further ado, here are the 91 documented programs.  
 __________________________________________________________________  

Ultimate chat application (linux)

Image
The Linux version of this very useful tool.
See also
chat_rb (which is really, really useful, it could replace bash and
ChatGPT)
__________________________________________________________________

Ultimate chat application.exe

Image
Windows version of Ultimate Chat Application.
There is so much potential with this program.
This is a non-AI chatbot. It's not based on generative AI or AI of any
sort.
It is self-explanatory, it tries to give a better answer.
Still a work in progress.
Source code is in PP.rb
Generates a hyper optimized C program that is able to respond to
prompts locally as fast as theoretically possible using switch
statements
__________________________________________________________________

Replace not in place

This is like gsub, but for strings, not for regular expressions
See also
gsub
__________________________________________________________________

Generate do more

Generate the job search program from the inspect program.
See also
inspect
job search, job search, etc.
__________________________________________________________________

Replace in place

replace_in_place tool replaces a string, not a regular expression, with
another string
Example
replace_in_place cat dog file
__________________________________________________________________

Emerald browser

Image
Image
Emerald browser is a really powerful new browser
See README
It works based on panes.
Read the documentation for “open”, “close” and also the README file.
__________________________________________________________________

Job search.exe

job search is a work in progress, but it works, and it helps you to
progress, in life
job search automatically generates resumes and cover letters for all of
the jobs that you could have.
COVID makes life hard.
People are unemployed, etc.
People could have more jobs.
job search is a graphical, cross platform program (generated from the
inspect_list program) that generates and downloads dynamic PDFs of
Resumes and Cover Letters that are tailored for each and every possible
job that you could apply for on Indeed. It is very freaking
practical!!!!!!!!!!!!!!!!!!!!!
First, you need to click on the bottom part of it. It copies that code
into your browser. Then you right click on a browser page and go to
“Inspect” (the same can be done by doing Control + F12). Make sure you
are on Indeed.
Search for something on Indeed, like “labourer”.
For each result, a new resume and cover letter will be downloaded, each
of which is geared for that specific job positing, with the company
name and copy role in both of them
This way, you can show employers that you really care!
The script will open up later pages on Indeed as well.
You can generate hundreds of resumes and cover letters as well
HTML documents will be downloaded.
You have to convert them to PDF, which chrome can do by doing
--print-to-pdf
Or you can do it manually
(On Windows, you can use Cygwin and do this )
(You need to be in the Downloads folder)
(Find it by doing “cd ”, “cd ..”, etc. )
for i in Downloads/*; do ./chrome --headless --print-to-pdf-no-header
“$i” --print-to-pdf=“$i.pdf”; done
Then you have to click on the second part, and run that in your command
prompt or terminal (Windows or macOS or Linux)
All of the generated resumes are numbered, starting from what you
enter, which is probably 0
They would look like 0_Business_Job.html
The pdfs would look like 0_Business_Job.html.pdf
When you run the second part, you will get notifications of the current
number
Then manually send all the custom resumes and cover letters to the
companies.
Chrome will be opened for you.
For each job, Chrome is opened.
When you close chrome, that job is considered applied for, and chrome
opens for the next job
You get a notification for each job.
It is REALLY streamlined.
For each job, that job positing gets searched on Indeed.
Oftentimes you will only see one result.
Which is what you want. Because it is THAT job.
This helps with so many things in life.
This program makes job searching easy.
When you click on the parts of the program, those TextViews get copied
to your clipboard.
You don't need to have anything installed on your computer.
The only requirements are
Ruby
Google Chrome
This program gives people a “buffer”, because it allows people to
easily apply for more jobs.
People can RELY on this program. Job searching doesn't need to be
arduous. This program helps with job search management.
Indeed is the most popular job search website.
This program uses that.
Count on this program, because it is here to serve all of humanity.
This program can help fix unemployment problems of an economy, in a
nonpartisan way.
Have you ever thought, that people don't look for work, because it is
hard?
People can work 2 or 3 jobs
See also
find_housing
to_buy
__________________________________________________________________

Gsub in place

gsub_in_place is like gsub, which replaces all instances of a regular
expression globally
=> result
Example
gsub_in_place . FOO file
Would make all characters in “file” become “FOO”.
gsub_in_place cat dog file
Would make all instances of “cat” “dog”
It is much cleaner than “sed”.
You don't need to have “sed” installed to run this program.
It doesn't read from the standard input
It takes exactly 3 arguments, no more, no fewer.
See Also
gsub
__________________________________________________________________

Find housing

This is a nice tool to find housing with! Everyone needs housing. This
can help with that.
It is a nice, simple command line tool. You enter the minimum and
maximum prices, and Kijiji opens with your options.
Along with the resume program, these tools can be VERY PRACTICAL
for daily things.
World War III might be scary, but if you maximize daily things you can
be fine.
See also
to_buy
__________________________________________________________________

Inspect list

This tool is really powerful
In an abstract world, there are lists of things
There can be lists that contain other lists , ]
This tool by inspecting a list
Does

  • Generates HTML from the list, with divs and spans
    You can then visually view that list.
    Or you can use the HTML for something else
  • Generates a GTK program for Windows and Linux, where that list is
    converted into widgets
    You are “inspecting” the list and turning it into other representations
    A resultant c_program is created for both Windows and Linux. You need
    to have MXE installed on a UNIX-like system to make it work (e.g.,
    Linux)
    The Job Search program was created by using this program!
    You could make an entire website with that program from the command
    line
    inspect
    cat list | args inspect
    also would work
    (See “args”)
    See also
    args
    job search
    The usage of this program is like this
    inspect , ]

Google speak

Google speak is really useful. It speaks a statement using the Google
Translate voice, which is probably the most authoritative and
high-quality text-to-speech voice that exists.
It's kind of like “espeak” or similar tools, but it is much better.
You need an internet connection for it to work.
It is probably limited at 100 characters.
There is a “singing program”, not really a tool, in this software
project that gets around that.
TODO
Make the alarm clock program in this software project use this voice.
It is quite reliable.
It is probably “unlimited”.
I haven't had Google block me from using it ever.
Which is a good thing.
__________________________________________________________________

Make server

make_server is powerful.
make_server takes expressions, either Javascript or C++, and generates
a resultant program from that.
The Javascript mode currently doesn't work.
Not only is a program made, the resultant program is an entire
webserver, that uses FastCGI to run really fast code.
The arguments work in an interesting way.
make_server
...
You have to give 4 arguments every time.
There was an “otherwise” mode as an “else”, but I don't think that's a
part of the program anymore.
It doesn't need to be.
You have to give 4 arguments for each function.
So you can do
make_server 4args 4args 4args 4args
And pass 16 arguments
The “iterable” has to be a list.
What is powerful is that it converts JSON into completely native C++.
It is very efficient.
It doesn't need to be a JSON expression though.
There is a test file.
You can run the tests and see if it works for you!!
You can also modify the code because it is open source.
The program generates a special array object. It is lightweight and
makes arrays act in C++ like arrays act in scripting languages, but
much faster.
The array class also has methods to apply things to every element of an
array, like surround
array.surround(“”, “”)
for example
would surround all of the elements of array with XML tags and return a
new list
This program generates a lightweight Object System, with a BasicObject
class and an Object Class.
You can subclass these objects.
You can have Arrays of the Objects
The function argument syntax is really powerful.
Oftentimes people want to iterate through iterables or arrays.
Oftentimes people want to check conditions.
Python has list comprehensions.
This is kind of like that, but simpler.
You can have arguments as one argument, separated by “,,”
make_server arg1,,arg2,,arg3,,arg4
What's the point of using a scripting language when you can use C++?
This uses FastCGI, so you can have an IDEAL webserver.
You can have an IDEAL and very affordable website, that in a sense
would be faster than Facebook.
Facebook converts PHP to C++ (slow)
This produces REAL C++, and it is very fast, almost as fast as
possible.
Native STL classes are used, like vector.
Native STL classes are used, like vector and map
Do you not need to run and child processes or do slow, costly things.
You should want IDEAL.
This is free software, and is BSD licensed.
The function generation idea allows you to write in 1 line what other
people might write in 50 lines.
You do not need to compromise your ideals.
You should want fast, efficient, and memory light programs that are not
garbage collected (!!!) and that have reliable performance.
C++, as everyone knows, delivers that.
You should also want to not have to write a lot of code to do things.
And you should also want safe, compiled code that checks things at
compile time, so that bugs don't appear at run time.
This program delivers.
It uses NGINX ( a really, really common webserver) to help with the
FastCGI.
FastCGI, for the unfamiliar, is like normal CGI, but there aren't child
processes.
So the entire server could be written in idealistic C++ .
Then you just have to think about scaling.
There are some relevant links regarding scaling in the “scaling” file
in the democracy project

  1. Speed
  2. Ease of writing code
  3. Memory usage
  4. Monetary costs
  5. Elegance
  6. Practicalness
    Those are 6 things.
    You don't have to sacrifice on those things.
    Contributions on this program would be really appreciated.
    It is called “make_server” for now.
    There was also a mode to generate javascript.
    I have to make that work again.
    The entire program is just one file.
    My email is gregorycohen2@gmail.com
    __________________________________________________________________

Selectlines

selectlines shows all nonblank lines from the input
Example
cat file | selectlines
(echo 2; echo; echo; echo) | selectlines
=> 2
The result would be 2, with no blank lines after that
__________________________________________________________________

Communicate

Communicate is cool.
Communicate runs a Ruby expression after speaking a prompt (the first
argument) and getting your verbal answer (using something unfortunately
called “nerd-dictation”, which is a wrapper around another program
which deals with speech recognition)
Communicate allows you to have conversations with your computer, and it
is cross platform
(Or it hopefully is)
communicate 'What is the best color?' 'case text; when /blue/; puts
“You are right!”; when /red/; puts “Red is a bad color”; end '
That would be an example of how one could use “communicate”
Make sure you have nerd-dictation on your computer
The name nerd-dictation is absolutely awful, and I have to criticize
him for not making it have a better name, but it works.
__________________________________________________________________

Super trans

super_trans is an offline translation program
It uses “Apertium”, which can do offline translation.
You can do translation anywhere with it.
It generates a webpage from the input text that not only has all
language translations embedded in it, it dynamically adjusts the
website page content to the web browser's “current language”.
You need to have a folder called “translation_folder” in your home
folder for it to work.
You can use the resultant HTML on your website, and if the user is
Spanish, French, German, etc., then that HTML element would
automatically be different.
This is really powerful.
Some notes
This is worse than t.js in this software project
The resultant HTML is really big. It is too big.
“Automatic translation” is really powerful.
This translates into literally dozens of languages.
See also
t.js
__________________________________________________________________

To buy old

Old to buy tool, not that good
__________________________________________________________________

Executable

Makes all the files in the current directory executable
__________________________________________________________________

Questions

This program allows you to communicate with all important people in
youife cycically and very easily. It's much easier than texting or
normal emailing.
See youtube.com/GregoryCohen1
See also
tb (to buy)
The youtube documentation video
__________________________________________________________________

Underline

Underlines text
__________________________________________________________________

Processes

Processes lists all processes with a certain name
For example
processes sh
processes bash
processes ruby
processes gsub
__________________________________________________________________

Emeraldc

EmeraldC

The Ultimate C Preprocessor
I'm naming this preprocessor “Emerald C.”
https://cboard.cprogramming.com/c-programming/181160-hi-i-have-created-
some-work-i-think-will-really-valuable-community.html?s=589b5504cd0e3c2
dc90e9abd8b66906f
Howdy!
First, let me state that I am very much a perfectionist.
C is a wonderful language. C is probably the perfect programming
language. It is one of the top two most widely used languages for a
reason.
Now, there are some problems with it of course, but it's hard to think
of a more elegant language than it.
It is the language of systems, the language almost all APIs are written
in.
It is the lingua franca of the software world.
People try to avoid it, but they needn't.
I think every programmer wants to find out how to do things, or use
libraries that make things easier.
Many programmers have done programming, grown dissatisfied, and then
make another language. As a result, there are thousands of different
languages.
Well, recently, I made a preprocessor for C, that makes C incredibly
EASY.
C is fast and straightforward without it, but it has many features.
If one runs the command line preprocessor, with the “--features” flag,
the program shows all of its features

A Better C


C is a fantastic language. C compiles insanely fast, is the fastest
language there is, is very clear, is native to all systems, and is
useful for all purposes.
Some people, e.g., Bjarne Stroustrup, consider that C is "not good
enough", and make languages like C++ or D (or thousands of others)
This is not necessary.
There is no reason to use Python instead of C for "simple scripting
tasks"
Some functions can be used as methods
Makes for an excellent “scripting language” (which is really just
native C without things making it slow)
1 String Interpolation “String interplation like this #{foo} ” Calls
the join() function (talked about below to join strings,
delim is a static global in each module called “sep”.
Make sure you free() the string after. The string is stored in a static
global variable called “last”.
So you could do puts(...); free(last)
2 ew i.ew “Foo”, a.ew “bar” | char ends with another char*?
3 sw i.sw “Foo”, a.sw “bar” | char starts with another char*?
4 == Comparison of strs, “foo” == “bar”
5 strip Returns pointer to string that was stripped, in place
6 chomp void function, chomps end of string of spaces, i.chomp or
chomp(i), in place
7 gsub Just like ruby, there is a gsub function.
The preprocessor detects if you use and adds -lpcre2-8 to the link
flags if you use it. Use $" for substitutions in argument 3 gsub(a, b,
c)
8 join Joins an array of strings, to split(), use C's strtok (very
fast)
9 Lightweight regexes are added, almost 15 times as fast as C's built
in regex. They are very simple, they only have bracket expressions,
like .
To use it, you need to pass a buffer of the size of the expansion of
the regex. Foo would be Foo. That would be stored
in a buffer.
From testing, 15x times faster than C's regex POST COMPILATION, if
compilation keeps happening, it might be hundreds of times faster.
Uses static inline functions, NO HEAP MEMORY unless you malloc
before().
10 print Like old python print “Hello” (fputs);
11 print_int prints a number and returns the number, can be chained
12 each_line, Perlish, different names, by_line(s) or each_line(s),
iterate over all lines, free after
13 NOTE You can use open_memstream() on UNIX to easily concatenate
strings.
14 MISC features || autoinclude, foo.gsub or gsub(...),no need for
paren (i.chomp, i.strlen), starts_with, ends_with, --wrap, itoa, freel
(frees str, sets to NULL, and frees other recent stuff)
asprintf() is another useful function which is UNIX-centric.
open_memstream() could be an alternative to std::string.
It works very well with each_line or by_lines (see above)
These features seem simple, but they can make C programming much, MUCH
easier
for example (insignificant example)
int main() {
stdin.each_line { |line|
print line;
}
free(line);
}

You can iterate over the standard input like Ruby
The thing with this is that it has 100% speed. The resultant
preprocessed program becomes a normal C program
The compile and run time for a program (if you use tcc and not gcc) can
be about 24 milliseconds, which is faster than Ruby to run.
Even though the program is preprocessed, re-preprocessed, compiled,
assembled, linked, turned into an executable, and then run
Kind of like early C++, this is a preprocessor for C.
But it's much faster to compile than C++. Significantly so.
Is anyone else interested in this? (BSD)
I'm realising this under the BSD license. I'm interested if anyone else
else likes this work, and would like to use it, or to work with me.
Best regards,
Gregory
Current program is written in Crystal (crystal-lang.org) -- it was
written in ruby, it could be ported to another language.
I would like to make this self-hosting, but that would take a little
bit of work.

About the Name

Years ago, I really, really liked Compiz
Compiz then forked into Beryl. There was the Emerald Window Manager,
which was really nice and beautiful.
I actually made another programming language. I made 2 other
programming language. One was a full compiler and assembler, that ran
code in memory. It was around 16 thousand lines of code. I made a
programming language that had the syntax of Python or Ruby, but
transpiled into C++. I called that C += 2. I used that other language,
and I created a Web Browser in it based on Chrome. I called it "Emerald
Browser." Emeralds are beautiful green gems.

"Emerald is a gemstone and a variety of the mineral beryl colored green
by trace amounts of chromium or sometimes vanadium. Beryl has a
hardness of 7.5–8 on the Mohs scale. Most emeralds are highly included,
so their toughness is classified as generally poor. Emerald is a
cyclosilicate." --Wikipedia

There was a browser with a terminal built in to it.
I show things off on my youtube channel, which I'm not going to link
here but is linked in my other repo.
This new language is better. It's ideal.

QUESTIONS

Why not use Rust?
$ time rustc a.rs
real 0m0.637s
user 0m0.502s
sys 0m0.160s

Rust takes 0.637 seconds to compile an empty file!
That is not ideal.
__________________________________________________________________

Last nth

Last nth gets the last n lines from the standard input
__________________________________________________________________

Speakcat

Speak cat is a tool like “cat”, which shows the content of files
(technically, it combines the content of files).
But speak cat also speaks the text.
Which could be useful in some circumstances.
It's kind of like “tee” to your ear.
__________________________________________________________________

Uca cli

CLI for uca app
__________________________________________________________________

Big num

big_num speaks really big numbers
Enter an expression, such as 2 ** 1000, and you'll see the result
__________________________________________________________________

Squeeze

Squeeze is kind of like “sponge” from “moreutils”
But squeeze is different.
Squ
Squeeze reads all input, then it prints it back omitting argument 1
line from the front, and argument 2 lines from the back
Example
squeeze 1 1
This would omit the first line and the last line
squeeze 5 3
This would omit the first 5 lines and the last 3 lines
__________________________________________________________________

Foreach

Reads a bunch of lines
Then a ruby expression is evaluated as the last line
The result is outputted in an argument.
You can enter /dev/null if you don't want an output file
“t” is better
See also
t
__________________________________________________________________

Dictate

Dictate opens web pages in emerald browser, or in any browser
(depending on the environment variable set), by you speaking, instead
of typing.
There is a mode called c_mode, that allows you to make code from
speaking.
__________________________________________________________________

Prepend

prepend prepends input taken from the standard input to a file
Usage
prepend
This is text to be prepended
__________________________________________________________________

Chat rb

This program is excellent.
It's essentially a mix of ChatGPT and a shell, such as bash or ZSH.
It has a bunch of features.
It can display a file or change to a folder just by mentioning it.
It outputs chatgpt data to an output folder in home folder and copies
it to clipboard
To run a shell command, prefix things with “c”, such as c gcc.....
__________________________________________________________________

Undump

undump is the opposite of dump
Example
echo cat | dump | undump
=> cat
echo cat | dump
=> “cat”
echo '“cat”' | undump
=> cat
__________________________________________________________________

Append

Appends text to file
Example
append file
This is more text to be appended
__________________________________________________________________

Email

A simple and practical tool to email people using Himalaya
Himalaya needs to be installed first
You would need to configure the script by changing its source code.
Modes
email
Email
email
Email one email address
email
Example
Email 'Gregory, I love your software!' gregorycohen2@gmail.com
my_friend@outlook.com person@example.com
__________________________________________________________________

Floor

Gets the floor of numbers e.g. 21.3 -> 21
__________________________________________________________________

Query

This is the top part of the job search, job search, etc. program for
Linux. The Linux program itself is called “linux_c_program”. The part
normally only works for Windows. This program works for Linux.
__________________________________________________________________

Lines

Lines gets the number of files in the current folder that you are in.
__________________________________________________________________

Clock

clock is useful
clock is a command line alarm clock
It wakes you up at 8:14, or at a time specified
Usage
clock
Runs clock
clock 15 30
Sets an alarm clock for 3:30pm
clock 9 0
Sets an alarm clock for 9 in the morning
It uses flite to wake you up
It speaks with a bunch of voices
To stop it
Run this command
clock stop
__________________________________________________________________

Emoji

Emoji converts words to emojis from the standard input
It can also speak the output
It can also copy the output to your clipboard
It is very useful
__________________________________________________________________

Close

“Close” is a simple program that closes “Emerald Browser”, a new web
browser based on the same engine as Chrome. Currently, Emerald Browser
only works on Linux and Mac (Or Windows with Windows Subsystem for
Linux or a Virtual Machine, but getting it to work might be tricky).
“close” closes the Web Browser, which is normally full-screen.
More accurately, it kills the browser, and all other copies of Emerald
Browser.
Since they are normally full screen, presumably the user would only
have one instance of the browser open.
The browser can have multiple panes (kind of like tabs) open, depending
on how the browser is compiled.
The browser can also be transparent, depending on how it is compiled.
“Close” is supposed to be used in tandem with “open”, which is a
command line tool to open the browser.
open ----> gets searched in google, and then opened
When you are done, you can do
close
Which closes the browser. It is a simple command.
Currently, Emerald Browser is incomplete. A program exists in this
software project that allows you to open up multiple browser tabs (one
or more tabs) simply by speaking.
Voice recognition would google the multiple sites that you say in your
query (separated by “and”)
“facebook and youtube and google”
It's hard to get more direct than that!
Emerald browser has a built in the top. The terminal is the navigation
bar.
Some more work needs to be put into the browser.
Currently, new tabs can't be opened, which might be a dealbreaker for
some people.
Currently, content, like YouTube videos, can't be made fullscreen.
If anyone wants to contribute, feel free to! :)
“Close” is a simple program that closes “Emerald Browser”, a new web
browser based on the same engine as Chrome. Currently, Emerald Browser
only works on Linux and Mac (Or Windows with Windows Subsystem for
Linux or a Virtual Machine, but getting it to work might be tricky).
“close” closes the Web Browser, which is normally full-screen.
More accurately, it kills the browser, and all other copies of Emerald
Browser.
Since they are normally full screen, presumably the user would only
have one instance of the browser open.
The browser can have multiple panes (kind of like tabs) open, depending
on how the browser is compiled.
The browser can also be transparent, depending on how it is compiled.
“Close” is supposed to be used in tandem with “open”, which is a
command line tool to open the browser.
open ----> gets searched in google, and then opened
When you are done, you can do
close
Which closes the browser. It is a simple command.
Currently, Emerald Browser is incomplete. A program exists in this
software project that allows you to open up multiple browser tabs (one
or more tabs) simply by speaking.
Voice recognition would google the multiple sites that you say in your
query (separated by “and”)
“facebook and youtube and google”
It's hard to get more direct than that!
Emerald browser has a built in the top. The terminal is the navigation
bar.
Some more work needs to be put into the browser.
Currently, new tabs can't be opened, which might be a dealbreaker for
some people.
Currently, content, like YouTube videos, can't be made fullscreen.
If anyone wants to contribute, feel free to! :)
__________________________________________________________________

Copy

copy copies the standard input
Example
ls | copy
__________________________________________________________________

Gsub

Gsub is very powerful.
Usage
gsub
Example
cat text | gsub man dog
cat text | gsub 'man|boy|cat|dog' food
ls | gsub Desktop cat
__________________________________________________________________

Dump

Dump surrounds its input with quotes
ls | dump
=> “....”
Use undump to get the reverse
See also
undump
__________________________________________________________________

Bold

See other color programs
__________________________________________________________________

Args

args is like a better xargs
args works properly with spaces in the name of commands
It takes exactly one argument
Example
ls | args “mv -t ../f”
__________________________________________________________________

Open

“open” is a very efficient program that searches a query from google,
and then opens it in Emerald Browser.
If you ever want something to “just open”, you can use it.
Example
open “cats”
An earlier version of open worked like this
open N
site1, site2, and site3 would all be opened, and the top N queries were
all shown in different panes
An even earlier version of this program used Chrome to open the sites.
The current version can open one or more sites.
Example
open “cats” “dogs” “frogs”
All of those queries would open in Emerald Browser.
Just make sure it is compiled in multipane mode if you want to open
multiple new sites at the same time.
See also
emerald-browser
close
__________________________________________________________________

Swap

Swaps two files
__________________________________________________________________

Exp

exp is an exponentiation tool
(echo 5; echo 3) | exp
=> 125
(echo 2; echo 10) | exp
=> 1024
__________________________________________________________________

Div

Div divides integers
Example
(echo 5000; echo 100)|div
=> 50
__________________________________________________________________

Mul

Multiply numbers
echo 1 > file
echo 2 > file
echo 3 > file
echo 4 > file
echo 5 > file
cat file | mul
=> 120
__________________________________________________________________

Nth

Nth gets the nth line from the input
__________________________________________________________________

Abs

Abs gets the absolute value of an integer
The absolute value of a number is the value of that number without its
sign
echo -300 | abs
=> 300
echo 200 | abs
=> 200
(echo -2; echo -10) | sub | abs
=> 12
The last one would do -2 - -10, the result would be -12, and then the
absolute value would be computed, and so the result would be 12.
__________________________________________________________________

Add

See the sub example
add adds integers from the standard input
(echo 1; echo 2; echo 3) | add
The result would be 6
__________________________________________________________________

Sub

Sub is a simple command line program that subtracts integers.
For some reason, no simple program did this.
Which is weird
Example
sub
(Input)
10
3
1
Result =>
6
Example
(echo 5; echo 2) | sub
Result =>
3
__________________________________________________________________

G+

A compiler for C += 2
Usage is like g++
Example
g+ a.cpp -o out
See also README file & emerald-browser and its source
__________________________________________________________________

Tb

SEE THIS YOUTUBE CHANNEL AND SUBSCRIBE
__________________________________________________________________

T

“t” is incredibly useful.
It can be used many, many times every day by computer power users.
It is kind of like “sed”, or perl, python or ruby.
It's the ULTIMATE shell “glue” tool.
t reads every line from the standard input, and for every line, it
evaluates a ruby expression
t a + 2
would add 2 to every line
Number automatically get converted to numbers in Ruby.
So one doesn't have to worry about that.
The “value” of the line of STDIN is any letter of the alphabet.
So choose any letter to do operations on and it will work.
You can also do
t a + 2 if a % 2 == 0
And you get a Python list comprehension sort of thing from the command
line
It is a lot simpler and easier than using awk, Ruby, Perl or Python
You could also have loops
echo “One line” | t a while true
The second line, again is a Ruby expression.
You can have really complex expressions on the second line.
You can even import modules.
cat /usr/share/dict/words | t 'a + “ is a good word.”'
That processes every word in the dictionary, and says that every word
“is a good word.”
There are other programs in this software project like “t”.
But if you do command line text filtering, t might be the best tool
that you will find.
See also
gsub
gsub_in_place

References

  1. https://www.youtube.com/GregoryCohen1
  2. https://facebook.com/democracygregoryc
  3. mailto:gregorycohen@gmail.com
  4. http://www.github.com/gregoryc/democracy
  5. http://www.rubygems.org/gems/democracy
  6. http://www.youtube.com/GregoryCohen1