Stefan Hayden

Alt + Ctrl + X
Archive for the 'development' Category

The steps to creating a form with autoform for editing user profile information are simple but not obvious when trying to tie everything together for the first time.

The first step is the set up the Schema. You need to set it correctly for the user data but the profile object is free form where you can add anything you want. Remember that all the things in the profile object are editable by the user. After you craete the schema be sure to attach it to the users collection.

Next you just need to create the form. The autoform quickform helper will spit out a form for all the user data, most of which you probably don’t want the user to be editing. Instead we can easily just show the fields we want to let users edit:

And that’s it. In the autoForm helper the collection accepts either a template helper (no quotes) or a global variable (quotes). For users you need to pass in the “Meteor.users” collection. To set what data to load the doc attribute needs an object with a _id property which the currentUser helper has.

Supervisor is a great unix program that lets you run persistant long-running programs. In general it’s easy to use and DigitalOcean ($5 a month hosting) has a great tutorial on how to set it up here.

I was interested in Supervisor because I wanted to run the mispy/twitter_ebooks repo for building some twitter bots. It gives you a great command line interface for both creating new bots (ebooks new <reponame>) and starting the bots (ebooks start).

For whatever reason you can’t just point Supervisor at a directory and call that command. You’ll need to find where the gem wrapper is located and run the command from there.

First find the path of the executable gem:

which ebooks

For me it was located here:
/home/shayden/.rvm/gems/ruby-2.2.2/bin/ebooks

Then we can switch the /bin/ dir to the /wrappers/ dir which is the packaged file you will tell Supervisor to run.

/home/shayden/.rvm/gems/ruby-2.2.2/wrappers/ebooks

In Supervisor the .conf file should now look like this:

[program:ebooks]
command=/home/shayden/.rvm/gems/ruby-2.2.2/wrappers/ebooks start
directory=/home/shayden/ebooks_bot/
autostart=true
autorestart=true
stderr_logfile=/var/log/ebooks.err.log
stdout_logfile=/var/log/ebooks.out.log

Now Supervisor should have no problems keeping your twitter bots alive and tweeting.

Getting one object to look at another object in Unity can be a very math intensive project.  In 3D there is an easy way to do this by use the transform to look at another object with a simple call:

Quaternion.LookRotation(target.position – transform.position)

In 2D Unity doesn’t hold your hand and you have to figure it out yourself. Most look rotation guides for Unity focus on simply modifying the transform even when talking about moving a Ridgedbody with physics.

If you want to use physics on Ridgedbody to add torque to turn toward another object then the unifycommunity wiki has a guide for 3D. With slight modifications we can get this same code working for Ridgedbody2D:

This is pretty spot on to my experiences. I do think there are ways to counteract this risk aversion to some degree. And I think Shutterstock has done a pretty good job of it.

Julie Horvath

What were a few of the biggest changes you saw with these companies as they grew?

Ligaya Tichy

So, in the early stages, I started at yelp it was 10 people and Airbnb was 12ish, and the passion index is high when companies are young because they can’t pay anybody market salaries. So the people who want to work there are people there love these products. And so there is this incredible excited and this sort of energy in these offices.

And as the company scales and there is more pressure to prove the product and grow. Then you need operations people. And a sort of hierarchy emerges, and operations emerges are really good at executing and incredibly smart, but they don’t… At this point you you are past series seed and at your series b or something like that. And you can afford salaries. And they are not doing because they love your company so much, they are doing it because it’s a great career opportunity or they like your product and they see some long term potential.

And then the company keeps scaling and and you just need work horses. you need people to do jobs. And so you fill those role. and you are growing growing very quickly. And so you just hire people who are good at filling one particular function. They may not necessarily be the sort of crazy creative people at the beginning that like wearing multiple hats.

And what happens is that your role changes. before it was really creative and kind of chaotic and some people really like that. And as the company gets larger. Your role gets more and more structured and it gets narrower. And some people like that because they like to focus and other people go like, “Hey wait this isn’t what I signed up for!”. And there is this attrition. There are just new classes of people come in and some people drop out. And as an early person it sucks when the people you love so much leave because they are what galvanized you every day to be there. Because you were building something together.

But this is the natural course of things. and you know I think me personally I figured out I am am an early stage person. when the company gets big it’s great but I don’t know what to do in those kinds of environments. I don’t want to be a middle manager. i like the chaos. I like building foundations. i like the unknowns and i like to experiment. And you don’t get to do that. The companies get much less risk averse.

If you are using Google Analytics you might see your own site listed as a referrer. Most commonly this is the case of having the same tracking code across multiple domains.

In the past this problem was mind numbing difficult to solve. Luckily Google has made this dead easy to fix with it’s new Universal Analytics. Sadly if you have an old Analytics account you can not convert it, but do not worry you can still keep that old tracking code on your site and track to both places.

Once you have set up your new Universal Analytics account you can follow the development guide to get it integrated on your site. Universal Analytics has a ton of new features and is well worth the time to set up.

The Fix:

In your universal Account go to the admin section. Find the “Tracking info” section. In that section there should be a option called “Referral Exclusion List”. Here you may list ANY url that you do not wanted to be listed as a referrer. And that is all it takes.

This does not fix old data and will simply stop this problem from happening in the future. Also the fix is not instantaneous. Each day the number of referals from the url you just added to the “Referral Exclusion List” will show fewer and fewer visits. In my experience it could take one or two weeks for the problem to be totally fixed.