dcurtis

Photoshop sucks

a lot of memory of course.

When I use it i can’t open anything else. Even with a 8 GB Ram, it hogs it all.

So from here on, I’m going to use Pixelmator for all Graphic Design. I’ll use Sketch for UI, but thats for later.

Its simple, easy, and got a lot of cool effects. Its not good in UI, but its amazing in doing graphic work.

Forget everything, and immerse in isolation

By default, people multi-task. It’s been proven ineffective by many researchers; yet people ignore all those evidence and keep doing it. Anyway thats not the case with me.

I know that i’m a uni-tasker, and I was happy doing it for a while, but multi-tasking just can’t accept that. It keeps buggin in from time to time, asking me to check this, and do that, and with the easily distracted mind of mine, I lose the battle most of the time.

Problem lies in external and internal distractions.

Internal

The solution I found for internal distractions is to …

Desktop

Launchpad

External

This kind of distraction seems inevitable, because anyone can call you for needing something, or co-workers interrupts to ask you about something.

For me I solved it by …

What’s the point?

Focus

Focus is the most important thing while working is to have those pure couple of hours. You can spend a day trying to solve a problem while it could’ve been done in just one hour. It’s not by the amount of time you give in, it’s the quality of work you get out.

Even if you love your work so much —as most of us do— Work is work, it’s tiring and sucks the life out of you. Try to grab best time to work, and dive right in for couple of hours, get back up, take a breath, connect with others, then get back down.

I tend distribute work across the day. To have couple of hours in the morning from 8-10, another session after my workout at 12-4. And final one at night around 7-9. This I consider too much work. So for you may be as short as 4 hours a day (If you are a designer). Change all you want but try to keep time from 20 minutes to 4 hours.

Respect your time before you ask others to respect it.

The Rails Code

Here is a few stuff that, I wish I knew, or I forgot along the way when developing asknative’s API. Just know that I didn’t have any previous REST or Rails background before that, so keep that in mind while reading.

Code Structure

  1. Controllers. Its job is to take data from the request pass it to models, then pass leave it to views. So don’t put any thing more than that, not queries not JSON response messages.
  2. Models. Defines your documents(tables in SQL), relations, queries it, and other functions thats needed for the model or controllers. It’s like helpers for Controllers. Most of your coding will be here.
  3. Views. Can be HTML, or JSON. So never define put conditions there nor queries. Thats what are helpers for. Even if you just do simple user.count.
  4. Helpers. Used for handling simple and complex functions that is only needed for the views. If you need something outside views scope, define it in the model. Else go with helpers. This will make your code readable, more easy to change, and accessed by other views.
  5. Gems. Give you extra predefined functionalities without messing your code.

Controllers = Managers (They never do actual work)

First thing to know is to keep your controllers thin, and models fat. Controllers are supposed to connect, and thats it. It manages everyone, so don’t put extra work on it. Because if you did, it would really be hard read or change your code unless you do that.

Use before_filter in controllers to handle repetitive tasks like User.find(params[:id]), and make sure you define who will need this using only and except.

If you have something that takes parameters, and needed in all controllers like limit and skip, you can define it as a protected function in the ApplicationController so that it can be accessed and changed for all the application.

If there is a case that you still don’t want to create a function in the model that handles specific tasks in the model, then create a private function that will be called in your controllers. So that you still have a clean and readable code.

As a general rule, controllers should only call functions, and if conditions that call specific functions for each situation then pass it to views. I can’t stress this enough, but this is the most important place to be readable, when you look at it, you should know what goes where and to whom.

Models are Fat

Models are helpers of the controllers, if you need a query or a function, it should be there. You can use def self.query to use it like this User.query without having to define it first. Which comes in handy for listing queries. But incase you need something simple go with scopes, they are simple and more efficient.

Use model callbacks like after_save, and before_save to handle errands. If you want to notify the user when there is a new post, then put it in after_save method.

Gems are cool

Everyone talks about how bad gems are when you are getting started with Rails, I disagree. I think they are amazing, as they help you see how you can do things correctly. Because when getting started no matter what you do you will mess things up, so I believe don’t try to run before you can walk, don’t get ahead of yourself. Use gems, and when you become strong enough, you can create your own gems that are specifically tailored for you.

Respect for RSPEC

I’m guilty of being scared of testing. I thought it was hard, but it turned out to be a life saver. It is extremely easy, and will get out of your way. You don’t need to open the browser to test a case, and you can’t the whole application in the browser every time you want to deploy.

Whats awesome about testing is that you can test everything, without doing it yourself. You don’t have to remember all the cases which broke your code. You just have to write it down.

For me I started doing this lately, so I still write dump repetitive code, but it works great.

Use watchr while you are refactoring so that it makes sure that nothing breaks, and if it does, you can handle it quickly.

Before deploy just run your test, and save your self some embarrassment after you deploy and find a stupid issue.

If you like this post, stay tuned for mongoid tips post.

Passwordless SSH to Ubuntu

I know this is a no brainer for most people, but it took me sometime to do it, so incase anyone having problems with connecting via SSH to Ubuntu here is a simple walkthrough.

  1. Create or Copy Development machine’s public RSA located ~/.ssh/id_rsa.pub
  2. Login to server and paste it in vim ~/.ssh/authorized_keys
  3. Ensure that /etc/ssh/sshd_config contains PubkeyAuthentication yes and RSAAuthentication yes uncommented
  4. Finally set chmod go-w ~/, chmod 700 ~/.ssh, and chmod 600 ~/.ssh/authorized_keys to make sure that permissions are set correctly

Update

For more information check this guide http://library.linode.com/securing-your-server . Thanks to @kamasheto

The Native Setup

I’m just a designer, but some stuff happened that resulted in me developing a whole REST API in Ruby on Rails. It was the first time for me to use Ruby but thanks to Rails community and Gems I learned fast and did something decent in no time.

Anyway I just want to share technologies we are currently using.

Server Setup

Rails Gems

Local Tips

Mistakes of a Native — Part 2

Continuing on my previous post

6. Never code without testing

Coding without testing is like climbing without a safe rope. Don’t expect your code to be working the same way after refactoring or adding a new feature. And relying on the tester to test all the cases he tested before is just bullshit. I’m not saying there should be no testers, but when discovering a flaw, it should not be able to make its way back to the application, and saying that its a waste of time or it will take more time, is more bullshit, because fixing bugs and re-fixing them will take more time from what you are trying to save.

7. Don’t sprint in an endurance race

The no sleep, no life, motivation speeches thing doesn’t work. In order to have a clear mind that is ready for work you need to stop the sprinting mentality with an endurance one. Go workout, have a good sleep, eat healthy, play from time to time, go watch a movie or a show, it’s not a wasted time, it’s what your mind needs in order to keep moving, and it will keep you from getting depressed. So keep your “all out” energy for times that you really need it.

8. Quality, Time, and Features

There is always sacrifice, and the best way to do it is to choose what are you willing to sacrifice. You can choose product quality with known cycles, but rolling features will be slow. You can choose definitive cycles and with lots of features, but quality will suffer. And finally you can choose quality and features, but take as long as you need or set a 3 months to 1 year period to make something perfect and polished.

It doesn’t matter what you choose as long as you know what you will sacrifice, and make peace with it.

9. Make some $$$

Don’t wait for enforcements to come, your alone in this shit hole, no one cares about your nor your startup, even if everyone likes the idea, doesn’t mean they are willing to share the risk with you. So the only way to deal with this is acting like there is no fund is coming, and find a way to make money before making your application. Show your worth before asking for money.

10. Launch

Launching is one of the hardes moments in your startup. It’s just a mixed feelings between fear and joy. You want to launch but scared that something will go wrong. So no matter what, launch first with little features, and no bugs, then add up as you go. By starting with less you will get feedback, be able to fix things fast, and know what features to add first.

Last words

When it comes to startups there is no definitive way of doing it, there is no recipe for success, so don’t regret any decisions you’ve done in the past. Past is only there to learn from, you can only become better when you learn from it.

Mistakes of a Native

No matter what you read in books or others tell you, you will make mistakes in your startup, so accept it, learn from it and move on.

1. A Team of Founders

Never hire when you start. It should be always team of founders, 2-5 having 3 the perfect number for Design, Development, and Business. Hiring people to do your job is not the solution, because no matter what you do, they will still be employees, in their thinking and in their way of working. Going for a one man show is possible but don’t expect to release anytime soon.

2. Hire the Heart not the Brain

When hiring don’t choose the best developer for a group of interviewee’s hire the one who got the heart and passion for what they do, hire people who follow their heart, hire people who match your Startup culture and mindset. They are the people who will stay up all night for the release day, they are the people who are willing to give what it takes, they are the people who will not ask for tasks if they are free because they know what needs to be done.

3. Defined Hierarchy

Startups tend to be loose and friendly —which is cool. But without defining responsibilities and decision makers discussions will have no end. So be sure that you listen to others, explain your point, then take the decision or let the responsible one do it.

4. A Moving Platform

This one is critical, for a social network, never start with closed platform. I can’t stress this hard enough. When you target wide and broad set of people a closed platform will always require a set of other platforms. Here is a scenario “We are on iPhone”, “Do you have Android?”, “No”, “Windows”, “No”, “BB”, “No”, “Can you make one?”.

That is really annoying but its the truth, everyone will always want his platform, and hiring teams or freelancing to develop on all these platform and maintaining them requires a hell of a budget. So IMHO go for a JS web application with local storage from the start, unless you are relying on Apple or Google mobile API to do something cool or replying on the AppStore to advertise your application. You can always target specific mobile platform later.

5. Find your customer

Don’t look for the customer after you release or while testing, go look for the customer before you even start. He is the one who is going to pay, do don’t imagine the situation for him, go in forms, twitter, facebook and find out what annoys the user and what other competitors are doing wrong, then go do it better.

You can tailor a software for yourself, but you still need to find other customers like you with the same problems.

Continue reading part 2

The Hybrid Era — Marriage of the Web and the Native

Why don’t we all just go web?

This idea doesn’t sound very good and there are lots of concerns, but it is worth it when done right.

The beauty of it lies in being easy and fast to push updates. Thats one hell of a problem when developing on iOS. Making a big deal for each and every update.

Another thing is not worrying about porting too much. You just port views and animations, but the content will be there.

There are lots of libraries out there. Problem is it doesn’t have the seamless native feeling yet. But we’ll get there very soon.

I don’t think native developers will die, but i don’t think the need for them will be as it used to be. Things are getting interesting much more interesting. The line is getting blurry and we are on our way to a one platform rules them all.

So whoever wants to rule the next 1-2 years you should be great at doing native web-apps on your mobile platform.

According to Gym

Another Person: I became fat.

Me: So why don’t you train?

Another Person: I don’t have time to go to the gym, I’ve got excuse1, excuse2, …etc

Me: Then why don’t you just go one week?

Another Person: One week wont do any good. I need to go everyday.

Me: Why don’t you start with only one week, then add up.

Another Person: I don’t know, I just don’t see the point in going one day a week.

Me: Ok, then workout at home.

Another Person: But I don’t have the equipment.

Me: You don’t need the equipment, workout with what you have. Do bodyweight workout.

Another Person: Thats a good idea. Lets train together.

Me: Ok, lets go.

Weeks Later

Another Person: I became fat.

Focus vs Goals: And The End of Resolutions

I’ve always been the man with the plan, always wanting to do something, change something, or learn something and planing ahead A, B, and even C. But most of the goals don’t get achieved and plan don’t work in any near way.

Happy New Year, I have 20 Goals to achieve this year, I want to do blah blah blah, and blah blah blah, …etc. This makes me feel bad every year, goals unachieved and can’t commit to something, but thats not reality.

People change, at least most people. I had a goal to start reading Novels, I tried to read everyday but at the end I couldn’t take it, it was just boring for me and I got distracted a lot, so I stopped. On the other hand, working out is pain during and after, and fear before starting, but I enjoy doing it, not because I want to look bulky, but to be in good health that allows me to do anything.

Goals. They are about having 1,2,3 goals that you want to achieve and having a plan to achieve them. Also goals allow having multiple goals under the same section of your life. Plans here work by having a plan, a backup and a backup backup plan.

Focus. They are about having an action that you want to do right now, next month, next year, or the rest of your life. You don’t say “I want to be the best weight lifter in the gym”, or “I want to have the best startup in my region”. You just say “I want to be healthy”, “I want to build my own startup”. Both may seem like an unspecific goals, but they are about having not expected outcome of what you do, they are just about having something you want to do, and you go do just that, let the outcomes surprise you. Planning just goes along the way, “what are the necessary steps that I need to take now to be healthy?”, “How can I build a successful startup?”. If the environment change and it will, be flexible enough to change your plans too, it not written in stone.

I want, and you want. Wether it is goals or focus at the end we all have something out of this life. A lot of people have a lot and big goals & dreams in their life, but they don’t work on it. They just want to be the best in their field and they don’t want to sacrifice neither time nor effort to be the best. They don’t do the most basic thing —which is reading— to become better. When you do your homework a lot of random things will happen, and give you amazing opportunities that you could never plan or anticipate, but you need to work hard first in order to receive them. There is no way around that.