Tumgik
#programming tips
packetpixie · 5 months
Text
pro tip for programmers - how to alias
hey, so you know that annoying thing that happens when you're coding, and you need to run/test the same program 100 times in a row, so you end up typing "python3 testScriptWithASuperLongName.py" into the terminal about 80,000 times?
well, there's a better way! it's called aliasing :D
in your bash shell (or zsh, or whatever shell you use, but bash is the default on VSCode and most people on tumblr use VSCode, so I'm using bash as the default to explain this concept) you can set an alias, essentially a shortcut command, that runs longer commands.
(yes you can just use the up arrow key to re-run the same command, but sometimes you're typing other things into the terminal too and you don't feel like hitting the up arrow key four times in a row, and also this is just a cool and useful tip to get comfortable with aliasing so shhhh)
so, in your terminal shell, just type this:
alias run="python3 testScriptWithASuperLongName.py"
now, you can run that entire super long command, just by typing the word "run" into your terminal. Here's a screenshot of an example on my computer to make it make more sense:
Tumblr media
in this example, i just created a simple python file that contains one line of code: print("it works!")
then, as you can see, by setting the alias to run, i can now run that file, runningatestscript.py, simply with the command 'run'.
the best part is, this alias is temporary - it only lasts as long as your shell session is open. so once you close the terminal, the run alias is cleared and you can set it again next time to any file or task you're currently working on, to save yourself a lot of typing, typos, and time.
so if you want to, you can get in the habit of always setting a run alias in the VSCode terminal for whichever file you're working with as soon as you get everything open. that way, when you need to run the same file 50 million times, you have a super easy way of doing it! you can even set it to a single letter if you want to go for maximum speed, but i prefer to use whole short words, because they're easy for me to remember.
note: if you do want to set an alias to work for all sessions, you can simply add it to your ./bashrc file. this is a common way to automate repeatable tasks, and simply to set easier-to-remember commands for terminal commands that are really complicated/confusing/hard to remember.
for example, i saved the alias checkboot="[ -d /sys/firmware/efi ] && echo 'UEFI mode' || 'BIOS mode'" into my zshrc file (zsh equivalent of bashrc file). this way, no matter how many times i rebooted my machine, i would always be able to quickly check which boot mode was running by simply typing 'checkboot'.
yesterday i was updating my boot mode from BIOS to UEFI on my very old machine that is technically compatible with UEFI, but not configured for it by default. So it was extremely helpful and saved me the time and headache of having to remember and type that long-ass command a thousand times in between many different reboots and new shells.
if you have any tasks like that, or terminal commands that you know would be useful to you, but you can never remember them when you need them, i highly recommend getting comfortable with aliasing! it can be super useful to simply set custom aliases for all the commands you don't want to remember, so that you can automate things away and not have to worry about so much linux syntax all the time when you're tring to focus on programming.
i know this may seem like a simple tip to some, but i only learned about it recently and it's been extremely helpful to integrate into my workflow and customize my OS with! so i thought it might be worthwhile to some people if i share :) hope it helps!
85 notes · View notes
the-pipistrelle · 1 year
Text
It is time! My tutorial has been live since this morning but i have finally crawled out of bed for coffee and am now functioning.
once again i am just so proud and excited to show this tutorial to you. it is based off of just one function i have built in my personal tarot bot named grimalkin. if this tutorial is any fun to you, let me know and i’ll write more on the other commands grimalkin-bot has!
thanks for all of your support. i will see you soon with a new one!
14 notes · View notes
tech-insider19 · 1 year
Text
Life cycle method in class-based components in React JS
2 notes · View notes
d0nutzgg · 1 year
Text
Sorry about the short hiatus.
We are now starting to improve from being sick with COVID enough that I have been learning some Java. I have been programming with Python for 10+ years now and I feel it's time to branch out and have chosen Java as my first SERIOUS programming language outside of Python. I have programmed in Go, some Dart, Ruby, JavaScript and several other languages but never really felt like they were something I could dedicate myself to learning like I have with Python. However, I have discovered a love for Java as the Java language is rich and also object-oriented more in the way that Python is (that's how I feel). I realize the syntax is a lot different, and I have had some learning barriers because of the complexity of the language, but overall I am feeling confident I have what it takes to become a great Java developer too.
My top tips for learning a new language for people coming from a language like Python are: Take notes: Notes are incredibly helpful when trying to figure out what you need for certain situations. I recently had some issues with the scanner object (taking input for Java) in which I had to look up what I needed from my notes. I now have built half of my first Java program!
Practice, practice, practice: Even if you understand a concept, if you are like me, you need to repeat it several times to cement it in your brain and be able to remember it the next day. There are many places to practice what you've learned but jumping into projects on Youtube, doing coding challenges, or trying to build your own solution to whatever you want to using documentation will help you a lot!
Join a subreddit or at least engage in a community: The most helpful thing outside of the other tips that I do when learning or practicing any language is to join a subreddit and search for programming buddies or people to make friends with who have similar interests. It's fun to code with other people and gives you experience working on a team as you would at a job! /ProgrammingBuddies subreddit is excellent for this!
Good luck everyone in your programming journey, no matter what part of it you are on! Thanks for following me :D
2 notes · View notes
seuncreative · 4 months
Text
Elevate Your Python Skills in Development, Coding, and Scripting
Tumblr media
Python, with its simplicity and versatility, stands as a powerful language capable of crafting sophisticated applications, automating tasks with finesse, and scripting ingenious solutions across various domains. Elevate Your Python Skills in Development, Coding, and Scripting is not just a guide; it's your passport to mastering the art of Python programming.
Python isn't just a language—it's a canvas on which you'll paint elegant applications, whether it's web development, game creation, data analysis, or software engineering.
Elevating Your Python Skills ventures into the realm of scripting, where you'll discover the art of automating tasks, orchestrating processes, and managing systems seamlessly. Imagine crafting scripts that save time, effort, and elevate efficiency to new heights.
However, Elevating Your Python Skills isn't just about syntax; it's about cultivating a mindset—an approach that fosters innovation, problem-solving, and a pursuit of excellence. It's about empowering you to write code that not only functions flawlessly but does so with elegance and clarity.
So, are you ready to embark on this journey? Elevate Your Python Skills in Development, Coding, and Scripting awaits, poised to unveil the secrets, unravel the mysteries, and transform you into a Python virtuoso.
Learn how here
0 notes
cacmsml · 1 year
Text
The Top 3 Programming Language in Demand in 2023
Looking ahead to 2023, the need for programming languages is predicted to increase. With so many languages to study, it may be tough to determine where to concentrate your efforts. Here are the top three programming languages expected to be in high demand in 2023:
1. Python: Python is a general-purpose programming language noted for its simplicity of use and versatility. It is frequently employed in data science, machine learning, and web development, making it a highly sought-after expertise.
2. JavaScript: JavaScript is the foundation of web programming, and its popularity is only anticipated to grow in the next few years. It is also used in server-side programming and mobile app development, making it a useful language to master.
3. Java: Java is a popular programming language that is used in enterprise-level applications such as banking and healthcare systems. It is also frequently used in Android app development, making it a crucial language for mobile developers.
While other programming languages exist, these three are expected to be in significant demand in 2023 and beyond. Learning one or more of these languages can help you remain ahead of the curve in the ever-changing world of technology, whether you're just starting out or seeking to extend your skill set.
Do you want to study programming and start a career in the fascinating world of technology? Join CACMS now to learn the skills you need to be successful! Our skilled educators will walk you through the principles of programming while also giving you hands-on experience working on real-world projects.
You may study at your own speed and arrange your education around your busy schedule with our flexible learning choices. In addition, our helpful community of learners and industry professionals will be there for you every step of the way.
Don't put it off any longer; join CACMS now and take the first step towards your ideal programming profession! Click the link to learn more and to enroll right now.
0 notes
devleader · 1 year
Text
1 note · View note
amandaroos · 1 year
Text
Having trouble with the "by" delegate in Kotlin? Don't forget "getValue" and "setValue" imports.
0 notes
tipsforstudents · 1 year
Text
Tumblr media
0 notes
izicodes · 8 months
Text
I made a beginner coding resource! 👩🏾‍💻💗
Tumblr media Tumblr media Tumblr media
Hiya! 👩🏾‍💻💗
I made a coding infographic/slideshow for anyone getting into coding and are stuck! I'm seeing a lot of new codeblr blogs coming up recently and they're all beginners and I have been getting a lot of asks which basically all ask "I'm new to coding, how do I start?", so I decided to make this at 1am in the morning real quick! 🥲😭
I genuinely hope that this resource proves beneficial to someone out there. And remember, if you find yourself still facing challenges or need assistance with anything else, please don't hesitate to reach out. I'm here to help! ✨
Link to the PDF: LINK
2K notes · View notes
kitkatcodes · 10 months
Text
✧・゚: Customize your highlight color! :・゚✧
Tumblr media
I recently came across a blog where when I went to highlight some text I noticed it was a unique color!!! (」°ロ°)」
AND IT'S SO SIMPLE TO DO
all you do is go to your css file and add this:
::selection { background: <hexcolor> }
Enjoy!! ♡⸜(˶˃ ᵕ ˂˶)⸝♡
1K notes · View notes
raininyourblackeyes · 1 month
Text
Christina Carreira and Anthony Ponomarenko's Whole Lotta Trouble/ Edge of Seventeen RD at 2024 World Championships
64 notes · View notes
thatsbelievable · 11 months
Text
Tumblr media
394 notes · View notes
tech-insider19 · 1 year
Text
ReactJS vs React Native — An Overview for Business Growth
1 note · View note
d0nutzgg · 9 months
Text
Want to Support My Research and Get Some Cool Subscriber Only Content?
Hey everyone, so I know a lot of you really love my programming stuff. If you want step-by-step tutorials on how to make certain types of machine learning models, python projects, and other awesome subscriber only content, while supporting my research and helping me donate to a good cause (15% of earnings will be donated to the HDSA to improve Huntington's Disease patient's lives as well as fund life changing research being funded by them right now, I will include the donation receipt each time I donate!), you can now subscribe to my Post+ subscription! It would mean a lot to me and I will ALWAYS provide proof of donation as well! I want to make a change, and you can help. I will start posting stuff for my Post+ subscribers as soon as I get my first Subscriber (I want to make sure you're in this with me before I start creating a bunch of stuff!) I will be gone tomorrow because of my teeth issue but I will be home tomorrow night. Anyways, it would mean a lot and I promise to give you an inside look at what I do and how to do everything I do!
Love you all, you are super amazing people!
0 notes
zzzzzestforlife · 4 months
Text
working student's survival guide for life 👩‍💻💻📱
also my phone's colors are a little happier today, yay! 🌷
Tumblr media Tumblr media Tumblr media
everyone tells you how to launch and advance within your career, but i haven't found a lot of advice about surviving the day to day that has actually consistently worked for me. so here are some tips and tricks i learned the hard way. none of them are a magic pill, but i hope it helps even a little bit ☺️ these are also not really limited to being a working student, adulting can be a pretty universal struggle 🙈
talk to a friend — preferably a friend who shares common hobbies rather than a shared career, location, etc. you don't have to be picky by any means!! i talk to friends who are in the same career, school, etc. all the time! i've just found that when i talk to friends who share hobbies, it eliminates stress so much more effectively because the topics tend to center around our shared hobby and i've never found out later that there was an ulterior motive for the friendship because it's all just for fun!
take lots of breaks — don't worry about appearing unproductive because your work will speak for itself. i used to have my butt pretty much glued to my chair from 9-5 and most days even beyond. now, i take breaks to exercise, read a fun book, complete my studies, sometimes even take a nap, and i get the same amount of work done!! of course, knowledge plays an important role and for a time, putting in those extra hours may even be necessary, but it should definitely not be treated as the gold standard!
get a hobby — this is closely tied to the first point, and no, watching TV doesn't count (unless you actively participate in the fandom by creating fanfic, gifs, etc.). it can be hard to find something that sticks. it can also be hard to accept that this is something fun that you can suck at. but don't give up!! try many things! try things you've already tried! and for the love of all good things, do not turn your hobbies into a side hustle!! (unless you also commit to having new hobbies outside of those)
you've probably already heard at least some of this before, in which case, consider this a friendly reminder — you got this! 💕
more survival guides: done is better than perfect, the best night routines start in the morning, organize your life like an engineer, high-energy productivity checklist, tech girlie tips, take control of your life, on doing your best
91 notes · View notes