Categories
Uncategorized Web Development

Why most current social platforms suck

One major problem with most current social platforms is they randomly ban people for things that are not offensive.

You can’t even make a joke on these platforms. They ban people for making jokes like the following.

Social censorship at it’s finest

Anyone with an IQ over 75 can clearly see I am making a joke here about how much Javascript sucks. In no way am I telling anyone to harm themselves or saying I want to harm myself.

What kind of petty broken censorship system is this?  Is this AI making these judgements? If so it sucks.
Did  some amateur that just started to learn to code, who is totally in love with Javascript reported this? If so grow up and learn some other languages and you will realize Javascript sucks.

I use Javascript all day every day for user interface creation, which is probably why I hate it. It just swallows things that should be an error or warning, making debugging harder. The 100% lack of a type system makes it really suck BAD BAD BAD. You never know what is going to be passed to functions. This. Don’t get me started on this in Javascript.
Javascript was one of the first languages I learned 15 years ago now. I have plenty experience with Javascript. I also have used Golang, PHP, Perl, Java, Scala, Actionscript, VB.NET, Sketchs, BASH and more. I speak out of experience not failure.

And if you are a Javascript fanboy and don’t know why it sucks… read this article. Javascript gives you secret hidden bugs and errors.

So much suck in 1 language

 

Categories
Uncategorized

Symfony events resources, links and videos

To see a list of all events use this command

 php bin/console debug:event-dispatcher

Built-in Symfony Events – this covers some of how events work in Symfony and the basic default events that fire with every request.

The HTTP kernel component – This gets to the core of Symfony and it’s event system. The kernel is driven by events. This also covers the basic flow of events that symfony follows when a request enters the system.

Events and event listeners – More information about symfony events.

The EventDispacher component – This is more about the symfony system events.

An example of how to use the EventDispacher component

Videos

This video covers how to create a custom event subscriber

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