Details
-
AboutSoftware Engineering student, I'm starting my second year soon. I love messing arount with weird languages like bash in my spare time.
-
Skillsjs, bash, java, linux and some perl
-
Website
-
Github
Joined devRant on 6/28/2017
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
If you don’t yet have a vps, now is the time to get one!
-
Welcome and good luck!!
-
The the examples in the book for the data structures class at my school are full of this shit. Damn you Sedgewick and Wayne!
-
C# is exactly java, but with more syntax sugar. I don’t see any way in which the one could be more readable than the other. C# is, however, a crippled language when used outside of windows platforms, because most of the standard library is part of the .NET runtime, and only part of that is supported by .NET core. Which is why I prefer to use java if I have to choose between the two.
-
The amount of awfull choices people can make in just 4 lines of code astonishes me. 🙉🙉
-
@FrodoSwaggins I think that your point of view is very synical. Most websites that show ads do so because that is what the market for content works like right now. The big public wants free content and if it’s not free they’ll get it somewhere else. For the most part, no one gives a shit if its worth it to pay, because they won’t even give it a chance. The papers you talk of are slowly dying all over the world because of this and while I agree that that’s sad, it’s just simple market forces at play here.
It’s still no more than fair that content creators make money from their content though, and in the current market, showing ads seems to be the most effective way. Saying that they should all just find some magical other way is just unrealistic. I myself don’t even use an adblocker, I just visit websites that respect their users and keep the ads complementary in stead of obtrusive, because I want to support the creators of the content I consume. -
@azous that’s not really the kind of fun stuf I meant, and not self hosted 🤗
-
This is why I don’t to flirt with dev women. I’d just feel like I was bothering/harrassing them because I’d just be the next nerd who tries to get it on. Still sucks though, being in a relationship with another dev is probably awesome.
-
Lets extend this to when other developers use git, but through a gui: “Hey, can you help me? My sync button isn’t working and now my code won’t run anymore! Git sucks! Why don’t we use google drive?” 😓
-
@ArcaneEye It has a .length public attribute. And I agree, it's ridiculous, but @abhishekb pointed out that it might be because of a challenge to calculate the length without using .length, so I thought it would be fun to take a look and come up with some other, i.m.o. more elegant ways :) (which still should never be used in any serious projects of course 😅 )
-
@ArcaneEye I thought it was java, but I guess they're pretty similar.
-
@abhishekb
Oh and it’s probably cheating but just doing
‘return Arrays.asList(array).size()’
Would also get the job done without calling .length 🤓🙃 -
@abhishekb Still though, putting the try/catch inside the loop in stead of around it seems pretty inefficient, and if also looks pretty clumsy. Also, he could just have used an enhanced for loop with a counter like so:
‘for (Object o : array) i++;’
doing it that way prevents the exception from even being thrown. -
@fuyukine hehe I like how you PascalCased that
-
@aki237 nope but for the sake of this joke cd ~ or cd $HOME gets the point across a little better :)
-
Sure, you can find the functions I wrote for it right here https://github.com/redrock9/... @PrivateGER
-
@Alice hmm I’ll look into the newlines thing , I think that might have something to do with the way I generate the url. The “ problem is hard to verify atm though, since the API seems to be down (all requests result in a bad gateway error).
-
@Kimmax I think spare time projects really should be about toying around, but I guess we differ in opinion there :)
@Alice @PrivateGER It definately WAS an "oh fuck what do I do now, I need to fix this" reaction, as I had somewhere to go and very little time to deal with it, so just adding a quick `tr -d '><' to the end of the line was the most convenient thing to do at the time 😅 💩 .
I had some time later today, though, so I made sure that the HTML is escaped properly now. Feel free to test it out! -
@MatiasConThilde I see, hadn’t thought of that... Guess I should have, but this is my first website so not really experienced with handeling user input. I removed all of the nasty script tags from the displayed texts and in an attempt to fix it added some code that removes < and > from the text when it is saved. I’ll look into making it more secure later today. What an adventure this web development stuff is!🤓 I’m of course sorry for any bad associations with the devBanner project that I might have caused. @Kimmax
-
@CozyPlanes cool! Thanks for extend me the honor of hosting your temporary front end, I will wear it with pride :). I don't know if I can be of much other use for your project though since I'm not much of a C# programmer, but I'll drop by your gitter chat later this evening (it's evening here) and see if I can be of any help.
-
I couldn't resist... made a little front end on my website to create banners with your API. You can find it at http://bashlord.com/devrant-banners it keeps track of the created banners and keeps the images cached for a while. @Kimmax @CozyPlanes @github Is it okay if I keep this online for a while?
-
looks like the site is down now though :(
-
I love it!
-
@cdrice Great! Never heard of shellcheck before, nice tool. I ran it over my scripts and removed a couple of quoting errors that I made. It would be great if you could
take a look at the following scripts. I understand that looling at all of them is a lot to ask, know that I won't blame you if you only look at one of them. After all, your poor eyes need their rest after what you saw :). The scripts are part of a tiny web framework that I am writing for bash (I know, I know 🙃 ).
the scripts:
BashtronListener.bash:
https://github.com/redrock9/...
ServerGenerator.bash:
https://github.com/redrock9/...
Template.bash:
https://github.com/redrock9/...
If you are curious about their usage you take a peek in App.bash, which is an entry point for a proof of concept app that I made:
https://github.com/redrock9/... -
@cdrice I almost don’t dare to ask, but would you consider reviewing some/one of my bash scripts? The combination of brutal honesty and 30 years of experience that you have would be a huge learning opportunity for me! 🙊
-
That’s because he’s using a shitty language! In bash,
[[ men -eq women ]] returns true! Bash is the real deal when it comes to gender neutrality! Everyone is equal in bash! Also works for
[[ transgender -eq human ]]
[[ gay -eq straight ]]
Etc. -
Simply because VIM has way more features than VS code, and I don't have to leave the safe haven of my terminal to get stuff done.
-
The only difference between declare and local is actually that declare has some more options, and local throws errors when used outside of a function or block.
-
@IllSlapU Unless called with the -g option, declare limits the scope of the declared variables to the block it is used in, just like local does. Local in bash is actually kind of an alias of declare as it takes the same options for type declarations like -a and -A. Which brings me to this: I think that using declare for ALL variables, even outside of functions is a very good habit. If this is done consistently:
- declaration of global variables becomes more explicit as you use explicitly state that you want to make the variable global by using the -g option
- You get explicit “type” declarations by using -a for an array, -A for an associative array, -i for an integer and -r for readonly constants.
- you get a consistent way of declaring variables, which is not dependent on the context of the declaration.
- if a script is using declare, you can source it inside of a code block without it contaminating your current shell because the variables will be scoped to the block. -
That’s a pretty readble script for someone who doesn’t know what he’s doing! My 2 cents:
- You are using sub shells where you don’t really need them. ‘Echo $(wc -c something) | bla ‘can become ‘wc-c something | bla’, wc already prints its output to stdout.
- I personally prefer using ‘declare’ in stead of local. When used in a function, declare behaves the same as local, but when using it outside of a function you still get the benefit of more explicit variable declaration. You can read more about the declare builtin by running ‘help declare’. (The -p option is awesome for debugging btw)