Categories
Uncategorized

It’s in my head it must be in yours. Why all documentation sucks ass!!!

Most documentation sucks. It seems most authors have this idiotic idea that whatever is in their head, all their knowledge etc. magically transfers to the user as they read it. These are the same kind of idiots you meet in society that drone on about shit they understand to the totally uninitiated like they are talking to a pro. These are the kind of idiots that while talking don’t even have the ability to notice their true live audiences eyes glazing over and heads shaking in confusion. Nope these idiots are comfortable being idiots and we have to suffer. I don’t get it.

Ever been reading along documentation and the author just keeps throwing out concepts/terms left and right without even giving a link, leaving you in the dark like WTF? Isn’t it fun?

Here is a tip to anyone who writes documentation. No matter how stupid simple a concept seems to you, there will be people, many people who have never come across the concept. Instead of being a snobby dickhead with an attitude like “Well you have to have a minimum idea of how blah blah blah works because I do”. You should provide information, links etc. to any concept that anyone may not have encountered.  It is not that damn hard and doesn’t take much time and it makes you look much smarter and much less conceited and narcissistic.

This is the exact reason I started this website. So much of the documentation for everything sucks ass. Most documentation I come across these days leaves me saying WTF. Look at openssl or openssh or example so many WTF’s in those docs.

And what is worse is the assholes who write blogs who just copy other blog posts. So you get entire search pages full of shit articles all repeating the same wrong shit that doesn’t work. Then that shit information ends up on stackxxxx.com sites from idiot kids who copy and paste shit for points and don’t care if the answer is right, they just want popular points. I often just avoid stack sites these days. Those sites are only handy if you are doing the most basic simple shit. Once you go into complex issues those sites are wrong answer land 100% of the time.

Categories
Uncategorized

symfony how to start encore watch

I use so many languages and tools I can never even remember the most simple shit about anything anymore . This is how you start symfony encore webpack.

yarn run encore dev --watch

Symfony docs how to start encore
https://symfony.com/doc/current/frontend/encore/simple-example.html#the-import-and-export-statements

Categories
Uncategorized

Bash how write large amounts of text to a file

I searched and tried for days to find the answer to this. All I wanted to do was be able to basically create a file and write text to it exactly as I had entered it in a shell script. Every suggestion on the internet was fubar.

Note : to run these commands, put them in a folder like test.sh and use chmod 755 test.sh to make it executable then type bash test.sh or sh test.sh or /.test.sh

I wanted to put something like this in a file from within a shell script.



Line one text
   Line two text
   line three text
   lets talk about some text

I tried everything. I googled for days and I finally found this article  where someone had basically the same need as me. Basically the syntax to put a bunch of text into a file from shell script is this.


#!/bin/bash
testFile=/home/akashicseer/tests/test-file.txt
if [ ! -e $testFile ]; then
    touch $testFile
fi
outside_var="Some text from outside hell"

cat <<TEST  >> $testFile
Line one text
   Line two text
   line three text
NEWVAR = values
lets talk about some $NEWVAR
or not
but look at some outside text $outside_var
TEST

This uses <<HEREDOC syntax but it also redirects the input with >>. This is the oddest syntax I have ever seen so I can’t explain why it works. I would expect the redirect to be at the end of the closing TEST, but that doesn’t work. Bash heredocs are the weirdest thing other than if statements I’ve come across. Learning bash has been like traveling back in time to the 70’s or 80’s the syntax is beyond odd.

Also you will notice I tried defining a variable in the heredoc. That doesn’t work. You can copy and paste the code above and see what I mean. You don’t get errors but the variable doesn’t expand. I don’t know if it is supposed to or not. Here is a link to some info about heredoc. However what you can do is define variables outside the heredoc and use them within, see the $outside_var.

If you read the “info about heredoc” link above( in links below too) it shows this alternate syntax which works too, and makes more sense. I honestly don’t know how or why  the above ugly mess works.


#!/bin/bash
testFile=/home/akashicseer/tests/test-file.txt
if [ ! -e $testFile ]; then
    touch $testFile
fi
outside_var="Some text from outside hell"

cat > $testFile <<TEST
Line one text
   Line two text
   line three text

   but look at some outside text $outside_var
TEST

This looks a little better to me than the other version. So there you have it that is how you write lots of text to a file.  I had to search for days to figure this out so I hope this saves at least one person some time.

Version 1 heredoc syntax
Version 2 heredoc syntax

Categories
Software Development Uncategorized

Linux xclip command makes command line life easier

I discovered a new tool today while adding my ssh keys to Github, something called xclip.

The xclip command makes it easy to capture output to the clipboard so you can paste it to another location like into a browser or word file etc.

The github docs above have you use it to copy your RSA key and save it for pushing your repository so you don’t have to supply a user name and password.

xclip -selection clipboard < ~/.ssh/id_ed25519.pub

The above tells xclip to put the contents of id_ed25519.pub into the clipboard. You can then use ctrl + v to paste it anywhere you need it.

Here is more info and examples on how to use xclip

Link to some man page  type info about the options it accepts as arguments.

Another link to similar info about xclip it’s options etc.

Categories
Uncategorized

C programming language resources and links

C Syntax Rules – Learn the ABCs of Programming in C Language

Above is a great link to get started with C programming languge

 

Categories
Uncategorized

Symfony doctrine remove column from entity table

I had to dig and dig and dig to find this. Explanation here.

php bin/console doctrine:migrations:diff

instead of making a migration, this command makes the migration file for you. Then you can run this command

php bin/console doctrine:migrations:migrate

To actually change the table.

Categories
Uncategorized

Undocumented parts and pieces of Scala magic

I constantly run into things that are not in the documentation of Scala or if they are they are hidden. This kind of stuff only increases the learning curve of Scala. Any increase in the learning curve decreases acceptance rates.

Self typing. The docs only show one single way, but low and behold there are more ways. Imagine that. Disambiguating ‘this’ in Scala, or what does ‘self =>’ mean?

 

Categories
Uncategorized

random interesting science articles

Wonder Material Mimics Desert Beetles and Cacti To Suck Water Out of Thin Air

Quantum researchers create an error correcting cat.

How earthquake resistant buildings work. – Cool article that talks about pyramid structures.

Categories
Uncategorized

Gitlab resources

Videos

What is Gitlab?


This video is an introduction and quick overview of what gitlab is and why you might want to use it.


GitLab CE Tutorial #2 – A Tour Of GitLab


Introduction to GitLab Workflow


Every single feature in Gitlab Plan

This video quickly covers the features GitLab planning offers. This is a 24 minute video about just the Plan feature of GitLab


Continuous Integration with GitLab CI

This video begins by discussing what Continuous integration is. The video then moves on to Continuous Delivery at ~6:45 At ~9:45 the video starts to talk about CI/CD with GitLab