Saturday was devoted to React.js which I only had a passing familiarity with through osmosis (Hacker News, other fora). React is a very interesting model of front-end development and I thank Azat for helping me grok its fundamental nature - that of composability - the ability to compose components out of other components in a modular fashion. The urge to update the DOM through a quick jQuery function still nags my brain and will have to be trained out thru repeated React usage. We ended up working on Nodeschool ‘learnyoureact’ workshop between presentations of theoretical explanations. Mentors were available to assist people with their challenges and Azat walked around helping a lot as well. There was a supplementary presentation on React Native, which I paid minimal attention to as I’m not currently focused on building mobile apps and even when I play around with Swift on iOS, it’s good to have a solid understanding of a platform before (potentially) ruining one’s understanding with frameworks.
Azat emphasized repeatedly the asynchronous nature of Node.js, which was our topic for Sunday. The format of the day was similar to Saturday’s with working on Nodeschool workshops (learnyounode, ExpressWorks, learnyoumongo) interspersed with theory and explanations of Node.js, Express.js and the usage of MongoDB with Node and Express. As I’d earlier played around with Node back in 2012 (but, regrettably hadn’t followed it through to a major project), I was aware of some of the basics but Azat’s explanations solidified my understanding and I’m excited to build on top of my newly acquired knowledge.
I find it worthwhile to mention that Azat has a personality. He not only delivers good presentations and helps with one’s code, but also describes various scientifically tested learning strategies such as spaced repetition. He clearly keeps up with the learning geekosphere online! He also took the liberty of filling the ‘space’ in our spaced repetition with a quick foray to introduce meditation! Enjoyable and unique.
Overall, NodeProgram has reinforced my belief in hard, weekend workshops - it’s the ideal way to get a quick, rigorous introduction to a new technology - far more sticky in my mind than going through a dozen tutorials online. One can’t discount the serendipity of meeting great people either.
Speaking of Javascript, I recently across this surrealist talk delivered by Gary Bernhardt titled The Birth and Death of Javascript. The futuristic retrospection delivered by Bernhardt is superb and truly mind-bending. It uses the mechanism of comedy to sneak in some pretty radical but feasible ideas for the evolution of Javascript and all programming 25 years from now. Do watch it!
]]>The link in the above tweet was to this:
As I was and am interested in working for Kickstarter, and was looking to shore up my portfolio, particularly with Ruby projects, I decided to take on the project.
After many false starts, I present to you…drum roll please…
The idea is to send a daily digest of Kickstarter projects that fit a certain criteria to subscribers, such as - The projects are close to the finish line (>80% of goal funded) - The projects are ending soon (within 48 hours)
I believe this will enable Kickstarter enthusiasts who don’t have time to browse the many interesting, worthy projects regularly to fund them when they most need help. Scanning the email in the morning takes 10-15 seconds, or more if you happen to find a project to like.
I hope I’ve fulfiled a need. If not, there’s always next time.
Enjoy!
]]>You can think of many others ways to do this of course.
I decided to go with the second option as it required minimal effort and has so far turned out
very well. This was accomplished with a single rails generate migration AddLastEmailToSubscribers last_email:datetime
.
This will create the following migration
1 2 3 4 5 |
|
From here, I can simply check if the :last_email is nil or a day before today’s,
and if so, then send the day’s email, and then update the last_email to Time.now
Simple.
]]>Really need to get a lot of work done including all the side projects, but gah sometimes biology comes in the way. Damn you Rotavirus.
]]>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
The view :
1 2 3 4 5 6 7 8 9 10 11 12 |
|
As you can tell, the problem was not in the view at all, but in this line redirect_to home_path
. Redirection clears the object.errors field, and therefore nothing was being displayed. I stupidly spent a lot of time fiddling with the view, instead of inspecting the controller action. Replacing the problematic line with render 'new'
(‘new’ is the action/view that renders the form) solved the problem by preserving the .errors object.
So, if you have any interest at all in learning Spanish, French, Italian, German or Portuguese (these are the available modules currently), click over to Duolingo, you’ll thank me later.
Oh, did I mention it’s absolutely free?
]]>The config looks like this
1 2 3 4 5 |
|
The emails were arriving when I tested the app by running rails server
but on the local pow server, authentication errors were the norm. Clearly the environment variables weren’t being set. So I googled pow’s documentation for how to setup environment variables, ending up on this page. While reading through the linked section, I missed something critical.
“Pow attempts to execute two scripts — first .powrc, then .powenv — in the application’s root. Any environment variables exported from these scripts are passed along to Rack.”
So I idiotically set about creating a .powrc file in my user/bin directory. Obviously this did not work, but I wasted an hour or so tweaking random settings trying to get this to work. Then I re-read the page, set about to fix the problem, which I did as follows.
touch .powrc
in my project’s root.
export GMAIL_USERNAME=username
export GMAIL_PASSWORD="my password"
touch tmp/restart.txt
And that worked!
]]>I understood the obsessive focus of talented hackers on customizing and shortening every part of the development workflow, including reducing one word (5 letter) commands to 2 letter commands, in an intellectual manner, but I hadn’t felt it, till I started experimenting with Rails development. Typing rails s
every minute can get old. This is where pow along with powder have been awesome. Now when I create a new rails app, I just run
powder link
to create a pow dev server for my app. Now, whenever I feel like testing out my app in the browser, I just launch powder open
and the app is served in the browser. This replaces launching the rails server, followed by switching to the server and navigating to localhost:3000.
So, I want to end by thanking the 37Signals dev team, along with Adam Rogers and Phil Nash for making my life easier.
]]>Okay that sounded way too high-brow. Nonetheless, I just came across this awe-inspiring post at High Scalability.
A creature as ‘simple’ as a slime mold is capable of amazing feats of computation by following simple rules that Nature has granted it through evolution. I don’t know whether scientists have deconstructed slime molds down to individual proteins and built up a whole model of it, though that seems unlikely and complex. And that’s the point! The organization and structure of a slime mold, though simple compared to multi-cellular organisms like us, is still extremely complex for our minds to deconstruct through observation and reason. There’s logic embedded in the structural complexity of the natural world not wholly visible to us.
Since I haven’t yet tried ‘genetic programming,’ I don’t know how effective it is in adopting nature’s solutions to some computation problems, nonetheless I should give it a shot sometime, perhaps using this book on HackerShelf
]]>1 2 3 4 5 6 7 8 9 10 |
|
Typing code like the excerpt above has developed muscle memory for me, and made me think of solutions faster, just as Zed said it would.
Happy typing!
]]>I wonder if any other MacBook Pro with Retina display owners have noticed tiring of the eyes to a further extent than regular laptops (including MacBooks). There seems to be more of an intense focus engendered by the Retina screen. The closest analogue I can think of is maybe watching a 3D movie.
]]>Presentations All the presentations came across as genuine without many marketing phrases that such events are usually full of.
The slide deck presenting Mongo was only partially informative. Many people who have no clue what ‘NoSQL‘ actually means would not have understood ‘document storage’ vs relational databases either. Some code samples would have helped.
Tyler Brock, who is responsible for the Ruby driver for MongoDB delivered the presentation. Incidentally, I’d just attended the NYC.rb Hackfest meetup the previous day where I’d met a cool dude named Bent Cardan who helped me get my new MacBook Pro setup with ZSH and iTerm and gave me a full demo of agile hacking on rails with Mongomapper which is an open source community-developed ORM/ODM for MongoDB. This prompted me to ask Tyler whether an ‘official’ ODM solution was on the way for MongoDB on Rails/Ruby. Interestingly enough, Tyler mentioned that he wanted to do an ODM and that since he’s in charge of Ruby driver dev, it would probably happen though not anytime soon.
I was surprised that the presentation had no screenshot of Thrillist or JackThreads sites as they are very hip and cool and people unaware of them would certainly have enjoyed them. The description of the various Thrillist sites was mostly abstract with very few examples thrown in.
This was followed by an enjoyably geeky description of the workflow and design process of a recent project within the company that involved handling user data on the various Thrillist Media sites. Detailed block diagrams illustrated the way they’d used lots of components – MongoDB, Redis, MySQL, nginx/unicorn, etc. I was hooked! My takeaway was the line, which I paraphrase as “When you are creating a universal API, everyone’s your enemy.” A succinct crystallization of the issue of defensive programming.
This presentation was the most statistics-heavy. Details included number of user check-ins and venues among others and the numbers were impressive. The CTO was the presenter and he gave us an overview of the scaling challenges that Foursquare faces. The part I found interesting was when he mentioned that since all history of a user’s activity is important in the future, the scaling challenges are very different from, say, Facebook or Twitter where past tweets or messages are mostly not accessed at all.
Offices
All the offices were open-space as expected but each had a different feel to it.
The 10gen offices felt linear and uncluttered. It was basically a rectangular layout with window views of SoHo on each end. A decent amount of natural light.
Thrillist offices felt like giant male dorm rooms with crazy posters including those of semi-naked girls on the walls, funny artifacts thrown about everywhere and a collegial atmosphere.
Foursquare’s main lobby is an atrium with very high skylights. The conference rooms are boxed inside very glossy um glass and hold iPads next to the doors with the schedule information. Overall the offices felt airy and calm but perhaps the Zen-like affects were due to the relative emptiness of the place.
People
An eclectic mix of people attended, though only eclectic in the tech scene not in a universal sense. Ran into a few people I know including a friend. The Thrillist people seemed to be the most laid back. 10gen technologists oozed C++ (hard to explain) while Foursquare devs looked like determined project deathmarchers.
Overall, a fun and interesting experience, highly recommended!
]]>