Ever coded an HTML static design site? Iām sure youāve encountered problems where youāve just installed some CSS framework then coded some additional CSS files. After youāve finished the code you run it on a browser then TADAHHH!
You can only find truth with logic if you have already found truth without it.
ā Gilbert Keith Chesterton.
There were overflows horizontal and vertical scrollbars. š
Itās a bit cumbersome to find where those scrollbar or overflow originated, so thatās what this article is for. In order to find those overflows, hereās a one liner that you can directly paste on your web developer console or just press F12 then the console tab. The console tab is the place where you look at javascript logs (console.log), anyways just copy this then analyze it first before pasting on your console.
Here is the full script which had been beautified for readability:
var docWidth = document.documentElement.offsetWidth;
[].forEach.call(document.querySelectorAll("*"), function(el) {
if (el.offsetWidth > docWidth) {
console.log(el);
}
});
If you analyze carefully the code, youāll see that on the first instruction it gets the current document offset width. Then it loops on all selector which are class and idās, if it found an offending or greater than the offset width it will print that element attributes and location.
Thatās all guys!
Let me know in the comments if you have questions or queries, you can also DM me directly.
Also follow me for similar article, tips, and tricks ā¤.
Success is neither magical nor mysterious. Success is the natural consequence of consistently applying basic fundamentals.
ā E. James Rohn.
Hi guys, last week Iāve worked on a vanilla Windows 10 client computer without internet but is connected to a LAN with many computer.
Iāve asked myself on how to get all alive computers in the network using only built in tools from Windows.
Here are the things Iāve did in order to accomplish this feat.
First thing I did was ping all broadcast IP using ping <broadcast ip> -t -i 4. This will ping the broadcast IP, this action will spread and send all message to all active computers in the network. After that we would wait for around 5-10 seconds, and execute the follow up command which is arp -a. The arp command will check the address resolution protocol and list it down.
The -i 4 on the ping command instructs to ping only on IPv4 (Internet Protocol Version 4) network. Thatās all there is to it. Kindly check the manual page of the commands for different flag combinations.
We can all fight against loneliness by engaging in random acts of kindness.
ā Gail Honeyman.
Hello guys, in life no one lives alone, and no one can live alone. In this TIL (Today I Learned) we will discuss the things Iāve learned when trying to socialize with other people building rapport and connections.
Establish artificial time constraints. Allow the potential source to feel that there is an end in sight.
Remember non-verbals. Ensure that both your body language and voice are nonthreatening.
Speak slower. Do not oversell and talk too fast. You lose credibility quickly and appear too strong and threatening.
Have a sympathy or assistance theme. Human beings want to provide assistance and help. It also appeals to their ego that they may know more than you.
Suspend your ego. This probably represents the hardest technique but, without a doubt, is the most effective. Do not build yourself upābuild someone else up, and you will have strong rapport.
Validate others. Human beings crave feeling connected and accepted. Validation feeds this need, and few offer it. Be the great validator and have instant, valuable rapport.
Ask āhow, when, and whyā questions. When you want to dig deep and make a connection, asking these questions serves as the safest, most effective way. People will tell you what they are willing to talk about.
Connect using quid pro quo. Some people are more guarded than others. Allow them to feel comfortable by sharing a little about yourself if needed. Do not overdo it.
Give gifts (reciprocal altruism). Human beings reciprocate gifts given. Give a gift, either intangible or material, and seek a conversation and rapport in return.
Manage expectations. Avoid feeling and embodying disappointment by ensuring that your methods focus on benefiting the targeted individual, not you. Ultimately, you will win, but your mind-set needs to focus on the other person.
Humans will be humans and humans are very dependent creature. Thatās all for it thanks for reading. Follow me on my social media accounts and also on my podcasts.
Everything about Mark Zuckerberg is pure hacker. Hackers don’t take realities of the world for granted; they seek to break and rebuild what they don’t like. They seek to outsmart the world.
ā Sarah Lacy.
Sometimes I need to talk to someone about some things and sometimes the conversation and rapport part doesnāt work out. Here are the things Iāve learned on how to have a good conversation to anyone.
Donāt multitask. Be present. If youāre the one talking, would you be happy if the listener is doing many things and like donāt care? So be present and active.
Donāt pontificate (meaning – express oneās opinions in a way considered annoyingly pompous and dogmatic.). Donāt just butt in when someone is speaking with their mind. Its considered rude to just cut someone who is talking, I think its same for every culture.
Use open-ended question. Go with questions that will create discussion not just question with a single word could answer.
Go with the flow. Follow the flow of the dialogues, and if you donāt like the subject of the discussion you can always say what you have in mind.
If you donāt know, say that you donāt know. Donāt be the all-knowing guy. Nobody likes the person who knows and pretend to know everything. Just say you donāt know if you really donāt know, and say no to smarty-pants.
Donāt equate your experience with theirs. Experience vary from person to person. It has different levels of emotions involved, donāt try.
Try not to repeat yourself. Speak clearly and with proper tone so the listener will know the intention.
Listen. Always listen, a great listener can be the most reliable person.
Be brief. Get to the point and donāt confuse the listener of what you want to say.
Thatās all the things Iāve learned with having conversation to different people and walk of life. Hope you guys, enjoyed this article and as always live life!
It is simply this: do not tire, never lose interest, never grow indifferentālose your invaluable curiosity and you let yourself die. It’s as simple as that.
ā Tove Jansson in Fair Play.
Recently, I wondered on how to check the file size of all files with a specific file extension on a folder / project. This is what Iāve found out after several experimentation using command line tools in Linux, this specific task could be accomplish with just one line of command. Check below for the actual command:
find . -name "*.dart" | xargs cat | wc -c
What this command does, is first find all file with the dart extension. Then pipe the output of that command in xargs converts the standard input to command arguments. After that pipe the output of xargs again to our favorite word counter wc.
Here are the command line tools use in the process.
xargs is a command on Unix and most Unix-like operating systems used to build and execute commands from standard input. It converts input from standard input into arguments to a command. Some commands such as grep and awk can take input either as command-line arguments or from the standard input. Wikipedia
find is a command-line utility that locates files based on some user-specified criteria and then applies some requested action on each matched object. Wikipedia
wc is a command in Unix and Unix-like operating systems. The program reads either standard input or a list of files and generates one or more of the following statistics: newline count, word count, and byte count. If a list of files is provided, both individual file and total statistics follow. Wikipedia
Thatās it!
So guys, do you have any one-liner commands that you want to share? Just message me on my social media accounts. Hope you guys enjoyed this article!
Itās how you deal with failure that determines how you achieve success.
ā David Feherty.
Hi guys, working 9-5 jobs is hard especially if its your only source of income. And almost every time, its not enough.
So here, will list down what are the best way to earn passive income (the Asian version).
What are the ways for a better future?
Here are the ways to make passive income even if you have 9-to-5 job. I know its never easy, and never will so we mustāve strive harder and think of more ways to earn.
Creating a mobile app
Making mobile app and deploying it to app store or play store can earn you passive income. Believe me there are ways, first is running mobile ads to your app. Another way is selling premium features of your app, but one thing is for sureāāāonce the appās deployed it will be like a cash cow sending you money.
Spreading affiliate links
Spreading links across the internet with your affiliate url is one way to earn money. By spreading your affiliate url, you earn commission for every user that would buy a product. This needs good marketing strategy, in order to earn more money in minimum amount of time.
Making Youtube videos
Many vloggers right now in YouTube are earning money from the videos they make. Post a video wait for viewers to view your content then instant money. But there is a threshold before you can earn money from this and mostly you have a lot of competitor. But sincerely its one of the best passive income generator.
Make a blog
Earning through a blog may take years, but it pays off when you have lot of readers. Also may take time before you get big. So start now! One of the ways you could earn money from it is sharing your affiliate link and giving reviews. As well as accepting ads or earning revenues from ads. If you donāt want to start from scratch you could buy a blog.
Creating online course materials and webinar
Online course is booming since 2015, and its expected to grow more. This is the best way to earn passive income, just create a content you want to teach and deploy it multiple times in sites like Udemy and Teachable. Once all your resources done, all you need to do is relax and wait for it to earn money. Similar to webinar, schedule webinar and deploy your pre-made course every now and then.
Creating e-books
With the increasing popularity of digital books, its now considered as one way to earn passive income. Authors now bypass publishers when publishing their own books. You could check out my article on using ascii doctor to create an e-book using opensource tools here. Selling those ebooks in sites like Amazon KDP, other way is sell it on your own store.
Selling photos
Photographs, selling photographs that has deep meaning or has an artistic side could earn you some bucks. Posting it to stock photos site like Pexel as many companies or individual that are searching for the right photo.
Becoming an early stage
One word risky, investing in early stage startup has many pros and cons. Being a seed investor gets you a lot of perks as you can join the startup and promote it. But one thing you should only invest in a startup you believe in.
Buying bluechip
Buying stocks is one of the best way to earn passive incomes, but you gotta have years of patience waiting for it to grow. Also picking the right stocks to invest could make you a millionair in just 5-8 years. Investing into it needs also large sum of money to gain large position increase.
Conclusion
In this day of age, there are ways now to earn passive income. Probably not so passive but still youāll only need to put 20% and earn 80% from it. This posts will get updates from time to time as it is still incomplete. Stay tune for more updates.