Hacking Daily Routine for Time Management

Daily Routine is a go-to for time management and keeping track of self but hacking daily routine for time management is something you ought to do for the purpose of proper drive. In traditional daily routine, it’s often time vs. activity i.e. activity is matched with certain time with fixture.

Traditional Daily Routine

7:00AM => Wake up
7:00-7:30AM => Freshen up
7:30-8:00AM => Exercise
8:00-8:30AM => Meditate
... and so on.

While this approach is okay to start with, I felt a major defect in the system. I tried to schedule my day in similar manner but the first day after planning I woke up at 7:45AM which was 45 mins after the targeted time. This left me depressed and not continuing or finishing up with the schedule. It’s not that I quit at the very first day, I tried for a week but minor delays was somehow affecting the whole flow.

After watching myself suffer with schedule which in alternative should be helping me, I started thinking that the time was not and should not be more important than my mental calmness, the sense of satisfaction. Hence, the alternative approach I came up with was valuing tasks based on the time it would take rather than fixed time frame.

Hacked Daily Routine

With that change the schedule came to be something like this:

Freshen Up => 30 Mins
Exercise => 30 Mins
Meditate => 30 Mins
... and so on.

Well, yeah! This doesn’t look much different approach then the earlier version but the feeling is lot more different. Wake up 10 minutes, 30 minutes or 40 minutes late than you planned to and still get the things done as you need to, feeling happy as a seal and getting the sense of achievement. No depression, no feeling bad, and not that much of rush either.

This is the hack I came up for my daily routine to do better time management yet being happy. Further, I divided the chunks into every morning, every evening and every night. Then wrote the sum of time the activities each division would take. Tie it up with Pomodoro Technique, and you should be catching up with Productivity Drive in no time.

Below is the picture of how my wall is framed with these activities, time and it’s division.

Hacking Daily Routine for Time Management

Hope this helps you as a life hacker and would love to hear your feedback on the approach and if you have better ideas and/or suggestion since I believe that Learning is Endless.

The Insufficiency of Good Design by Sarah Mei

As a developer you should have come to a point where you think about quality of the code you write. You must have wondered what good code actually is and how good design can be achieved. This talk by ‘Sarah Mei’ clarifies the idea of Good code and also provides guideline of how it can be achieved. Good code isn’t written always by everyone. Hence, we need to keep these points in the back of our head which are noted below.
Continue reading

Custom fonts with Wicked PDF on Rails

Well! We all have had a hard time getting through the custom fonts in our website or web-application. It has been easier with the @font-face implementation through CSS though this requires different formats of file integrated through it.

This implementation was OK until our client wanted to have the custom font implemented in the PDF generated by wicked_pdf in our Rails Application. This was not working right as intended, PDF using the default font rather than the custom font specified. And yes, we couldn’t even inspect element to diagnose the problem as could be done in webpage.

I also tried specifying the path to fonts explicity as mentioned here and below, but it still didn’t solve the problem.

# app/assets/styleshsheets/fonts.css.erb
@font-face {
  font-family: 'ITC Franklin Gothic STD';
  font-style: normal;
  font-weight: 300;
  src: url('<%= Rails.root.join('app', 'assets', 'fonts', 'itcfranklingothicstd-book.eot') %>') format('eot')
}

Searched through Google for some time and went through different articles to then sum up with the solution:

Solution: Base64 Encode @font-face

Yes, we can actually base64 encode the font-face and then use it through CSS @font-face to have it implemented in our website or web-application. This actually solves the problem of using custom fonts with Wicked PDF on Rails.

First, base64 encode ttf or otf of the font-face which can be done with CLI in Linux or Unix:

$ base64 /path/to/Verlag-Black-Italic.ttf > /just/to/save/verlag-black-italic.txt

Then copy the base64 encoded text from /just/to/save/verlag-black-italic.txt to paste it in the @font-face as mentioned below:

@font-face {
  font-family:"font-name";
  src:url(data:font/truetype;base64,[paste-base64-here]);
  font-style:italic;
  font-weight:900;
}

Wohoo!!! Now run the PDF generator with the CSS implemented for the font and see the magic happen with your custom font implemented in the PDF. This should make you and your client happy and smiling! 🙂

Do leave a comment below if this could be done in a better and/or easier way as Learning is endless…

Resources

Clash of Clan for productivity

Clash of Clan for Productivity

Hey Readers,

Have you guys ever wondered how we can get more productive? More productive as in a sense to get more things done and continuously. Well if you wish to gear up and boost your productivity meter then here is something for Clash of Clan fans.

Distraction for Concentration

sushil10018, Sushil Shrestha

One thing I knew after having long hours of work in office and by myself as a freelancer and spending lots of nights with my mac is that “distraction is necessary for concentration”. One can not simply keep the concentration max at all time and hence require a timely distraction. If you’re a smoker than you should have experienced the rage of concentration after a cigarette. Though, I’m not invoking to smoke of course! 😛

Playing Clash of Clan helps and how is the question. Well, the game is really addictive as it cooperates with the time in real life as troops take some time to train, the defenses takes real time to upgrade and so on. Now, coming to the point of productivity we’re going to use the game as timer. So, once you train a troop to be full in your barrack it would take around 15-20 mins if you’re only training archers and barbarians. Once you have the troops on training, you begin to work then a notification pops up which says that your troop are ready. You then search for the opponent and get some loot. This gives you a good break of around 5 mins and surely refreshes the mind. The second thing you do after loot is train the troop again as always. While the troop is in training you start the work again and so the day goes on.

This process helps a person not to stress himself/herself out with the work pressure and maintain the balance of concentration with distraction. It has been very helpful to me as I was experimenting upon myself. Do try and let me know how you feel about it. You may even remove your smoking habit trying this out! 😉

Best wishes using Clash of Clan for productivity!
@sushil10018

Is class required while experimenting Ruby codes in file?

Dear Rubyists,

There I was trying to guide a very good friend of mine, Sajin Shakya who was keen to learn a programming language, Ruby On Rails. I suggested him not to jump onto Rails and dig deep into Ruby first. Hence, as he had learnt C programming earlier, I told him to practice developing similar algorithms he’d previously learnt in his academics through Ruby.

So, he created a method which would calculate the factorial of given number as follows:

[code language=”ruby”]
require "benchmark"
puts Benchmark.measure{
def fact(n)
if n == 0
1
else
n * fact(n-1)
end
end
(1..50000).each do |n|
end
puts fact("5")
}
[/code]

The benchmark seen was added later to check the performance of the code snippet in comparison to that I suggested to him which looks like this:

[code language=”ruby”]
require "benchmark"
puts Benchmark.measure{
class Integer
def fact
n=self
if n == 0
1
else
n * (n-1).fact
end
end
end
(1..50000).each do |n|
end
puts "7".fact
}
[/code]

My first thought before suggesting was if the method definition would work without class definition or not. But to my surprise it was working fine. Then he questioned me why we should be defining the method within the Integer class rather than defining it externally as he’d done. Also, his thought was that it would reduce the line of code as defining class would not be required.

I convinced him with how important the class could be to make our coding life easier but he resisted that in this case it was not required to define the class. Now, our focus was on if the particular change was required to experiment ruby codes in file or not. Hence, the question arose “Is class required while experimenting Ruby codes in file?”.

We benchmarked and noted the difference with the performance but it was not that noticeable. Then, we moved on to figuring out what the difference we could get from these two routes.

The difference noted was that the method were defined within specific class meaning that only that particular class would get the defined method and hence, the error would pop-up immediately if the method implementation was made in a wrong class. And since we’d always have integer to calculate the factorial it seemed legible.

In the first case if a “string” was provided to the method then it would pop-up the error after running through the codes in the method. But in second case it would not bother to run through the codes as it is a “string” and the method is defined for the “integer”. The errors observed can be seen below.

checking the difference

Please feel free to comment your thoughts and help us figure out.

I feel like the nucleus of an atom,
centrally located and densely tightened, fissioning,
into fragments of lighter nuclei
and extracting lump sum of energy
to even frighten my own lost soul.

sushil10018, Sushil Shrestha

What is a share

Don’t you want to earn money without having to work for? Planning to start investing but don’t have enough money? Well, I think share is a great idea. I do believe we can make more out of share just by understanding it in depth. These videos helped me a lot in clearing the idea about share and investment. I’ve made short notes of these videos to help me memorize hope it will be helpful.

Continue reading

Don’t wait for opportunities, they need to be created!

sushil10018, Sushil Shrestha

Most people seem to be waiting for opportunities and complaining for not getting them. But in fact, they are created. How? you may be thinking. Well, every single action you’re doing might create you a better opportunity. Just Keep on doing best of what you are doing when you’re doing it.

Please let me know if you agree or disagree with this through comments below.

Rich Dad, Poor Dad

Rich Dad Poor Dad Cover

I’ve been tired of working 9 hrs a day for money. I have an extreme desire of not having to think about money while spending. But I won’t be able to fulfill my desire if I go on doing what I’m doing and how I’m doing it. That’s the reason why I haven’t been able to get financial freedom.

So, while I was going through these thoughts and asking for suggestions. I was referred this book “Rich Dad Poor Dad” written by Robert Kiyosaki.
Continue reading

Validation on create with Ripple (Riak On Rails)

Previously I mentioned how to achieve Uniqueness Validation With Ripple.

Similarly, Ripple doesn’t provide direct method for adding validation only on create while trying to implement Riak On Rails using Ripple as modeling layer. This is very much necessary for the validation of properties such as password which are to be checked only while being created. Below is the code sample I developed for validation on create manually.
Continue reading