Tammer Saleh : The Number One Trait of a Great Developer

An excellent explanation about why simpler code and code choices are better.


When I look around at other companies hiring Ruby on Rails developers, I see them focusing on three major traits: Super-smart; Large community following; Deep Ruby knowledge. They’re all wrong. While these are great aspects in moderation, they all miss the number one quality of a fantastic developer: Judgement.

Tammer Saleh : The Number One Trait of a Great Developer.


DigitalOcean is Perfect for My Needs

I’ve been working on Gallerus.com for a while now, and I needed somewhere to host it. My friend Steve recommended http://www.DigitalOcean.com and the setup process was super simple.

They charge about 5$ a month for a decent server setup with easy upgrading.

I was also able to spin up a number of temporary servers to play with as well as duplicate servers for continuous integration, staging, etc.

All in all, they seem to be a fantastic company and well worth the money. If you know how to administer a Linux box, they’re a great choice.

Setting Size on wx.TextEntryDialog in Python WXWidgets

The process of showing a dialog is easy, but making a text prompt for the user that’s more than one line and in which you’re able to see more than one line is a more tricky thing. Here’s the syntax that worked for me.

dlg_msg = 'Hey user! Enter your text below:'
dlg_title = 'This is a title'
dlg_default_style = "{}"
dlg = wx.TextEntryDialog(parent=self.view, message=dlg_msg, caption=dlg_title, defaultValue=dlg_default_style, style=wx.OK | wx.CANCEL | wx.TE_MULTILINE)
dlg.SetValue("default value\non two lines")
if dlg.ShowModal() == wx.ID_OK:

The vars above the declaration are just for readability. Please note that dlg_default_style is a string, not a dict.

Please note that the default style, though empty, is necessary for the multiline entry to be picked up (at least on OSX)

Understanding Express Middleware in Node.js

Middleware is one of those interesting concepts that once you get it is very, very helpful. I learned this from making the autominify middleware for express.

The concept goes like this:
Express is initialized. Each time you add an app.use call, it appends it to a list of things to try every time someone requests a file. When a file is requested, each of these is called in turn and, if they don’t care about the request, they call a next() function and Express moves onto the next app.use call. If nothing claims the request, a 404 is called.

The syntax is pretty simple, but there’s some useful things I’ve done in autominify that you might want to use, as well.

This is the simplesty example of this I could think of. An inline function only executes if “helloworld” is somewhere in your url. This could be as simple as
and it would produce “helloworld” as the page.
If you didn’t have helloworld in your url, it would process as normal.

app.use(function(req, res, next){
	if(req.url.indexOf('helloworld') != -1){
		res.writeHead(200, {'Content-Type': 'text/plain'});

Remember that app.use executes in order, so if something else handles the request before you do, you’ll never see your code work.

If you’re looking to make a module, here’s the basics you might need.

//in app.js
var myModule = require('myModule');
//file called myModule.js
module.exports = function (goodbye) {
	var mainText = "hello world";
		mainText = "goodbye world"
	return function (req, res, next) {
		if(req.url.indexOf('helloworld') != -1){
			res.writeHead(200, {'Content-Type': 'text/plain'});

You’ve passed in true as an init param. This would mean that all sessions that are handled with this middleware (any request with helloworld in the url) would receive “goodbye world” as the text on the page.

But your kids have more to gain

The Bard Debate Union was founded in 2004; in addition to hosting a robust public debate series and sponsoring a number of community based outreach projects, the team competes nationally in the British Parliamentary Debate Format. Professor Ruth Zisman of the Bard Philosophy Department, one of the co founders of the team, directs the program together with David Register, Faculty member of the Bard Learning Commons and Faculty Fellow in the Bard Prison Initiative. The highly decorated, award winning Bard Debate Union is also proud to be integrating debate training and education into the innovative and world renown Bard Prison Initiative a program through which incarcerated individuals across 6 New York State prisons enroll full time in coursework and earn degrees from Bard College.

replica oakleys Legislation, because I think very often these things come back years and years and years later,” said Kinney. “I think the church needs to do everything it can to stand on the side of victims, and certainly that would be one way of addressing the issue. Standing on the side of victims that is, and not lawyers.”. replica oakleys

cheap oakley sunglasses “The case has been amicably resolved and will be dismissed,” said Thomas Carlock, an attorney representing Lewis. A suit filed by the family of the other victim in the fight was settled previously. Terms were not disclosed. Guys ride him, especially ex players. When you got a history, when you can go and google your history, you need to be a little careful with what you say. Sometimes when guys get on a microphone in front of their face they just talk and talk and talk and forget about their history. cheap oakley sunglasses

fake oakley sunglasses “At The North Face our mission is to inspire a global movement of outdoor exploration,” said Todd Spaletto, President, The North Face. “By tapping into the power of IBM’s Watson, we can ensure our customers get the best jacket for the activities they love cheap oakleys, whether that’s ice climbing in Montana or skiing in Vermont. This not only improves their online shopping experience, it ultimately maximizes their outdoor experience.”. fake oakley sunglasses

replica oakley sunglasses Sport: Track and fieldAthletic accomplishment:Cannistraci continued his unbeaten streak in the shot put on Feb. 26 at the Dream Big Invitational by thowing 56 feet, 10.5 inches, setting a meet record. He’s ranked No. But your kids have more to gain. A dad who can support himself and contribute to a healthy co parenting plan. And a mom who’s willing to stretch, in the “best interest of the kids” to give that same dad some additional time and rights so that he can show up in the best way replica oakley sunglasses.

PHP, Python, GoLang, and Node.js all served by Apache port 80

I dabble in node.js, php, python, and more. Often, these services will produce webservers, and I’d like to try them out in my browser. I also would like to be able to test redirects for things like oauth. In order to get a proper passback from somewhere like Facebook, I need to simulate a full website url without port. It also would be nice to do this without having to shut down one, adjust settings, and restart the other.

The concept:
/etc/hosts or Windows/system32/drivers/hosts will handle incoming request handling to a url

  • Apache handles all requests from port 80
  • Apache uses VirtualHosts to redirect traffic from port 80 to various ports
  • Node/Python/Go/Etc. Will handle requests from specific ports.

An example:
/etc/hosts:   local.simplestexplanation.com

This tells your computer that every program that requests data from local.simplestexplanation.com should be forwarded to your computer. This is true for all protocols, http, https, ftp, etc.


<VirtualHost *:80>
    ServerName local.simplestexplanation.com
    ProxyPass / retry=0

We’ve told apache to create a VirtualHost on port 80. The servername matches the entry in /etc/hosts. The proxypass indicates to where we should forward this request, in this case, to local port 3000. retry=0 tells apache not to cache the results and to always try to serve the page (even if node was down last time)


https.createServer(options, function (req, res) {
  res.end("hello world\n");

This is a basic node server using port 3000. If we receive a request to http://local.simplestexplanation.com we should see it handled by node.

Similar servers can be set up in Python, GoLang, etc. And as long as they don’t steal port 80 from Apache, they can handle requests as normal. I’ve found this very useful.

Javascript dump or print_r output or toSource() alternative output

You can use JSON.stringify to receive a JSON-style string, but sometimes you want an actual javascript notation, not just object notation. In that case, it’s tough to find a reasonable output. I’ve heard that firefox has a toSource method of objects that outputs something like I needed, but I wanted cross-browser compatibility. Here’s how I did it:

function dump(obj, pad)
	var output = "";
		pad = "";
		output +="[\n ";
		for(var o in obj)
			output += "\t"+pad+dump(obj[o], pad+"\t")+",\n";
		output = output.slice(0,-2);
		output +="\n"+pad+"]";
	else if(typeof(obj)==="object")
		output +="{\n ";
		for(var o in obj)
			output += "\t"+pad+o + ":" + dump(obj[o], pad+"\t") + ",\n";
		output = output.slice(0,-2);
		output +="\n"+pad+"}";
	else if(typeof(obj)==="string")
		output += "\"" + obj.replace("\"", "\\\"") + "\"";
	else if(typeof(obj)!=="function")
		output += obj.toString();
		output += "\"FUNCTION\"";
	return output;

Google Hangouts™ is a Contender to Solving Remote Team Members

Everyone’s been talking about how remote working is important and how we should be embracing it as a coding culture, but few people have outlined the problems and solutions to fix them.
We’ve begun using a persistent Google Hangout as a means of connecting remote people to our office. The effect has been extraordinary and has really bridged a gap we had all felt in our team.

Some of the problems we’ve faced:

  • People use work from home/remote as vacation
  • Managers unable to verify if people are fully utilized
  • Lack of communication between team members

I’ve chosen these three because they stood out in the company I work for. I’ve been denied work from home requests due to the lack of oversight, and the abuse by people on my team. Honestly, I feel like it’s the output that matters and if we’re pushing things out on time in high quality, we should worry less about hours in front of a computer and effort spent. Convincing other people of that, however is an impossible task and won’t be discussed here, especially since I think we’ve found an excellent compromise.

Some of the facets that make this solution better than things we’ve tried before:

  • Google Hangouts are more like a room where people can meet, not a phone call people occasionally make
  • Remote people can hear what’s going on in the room while they’re out and chime in as though they were present.
  • They also can mute themselves if they don’t want to have home noise affect others.

This has had some unexpected results. People who enter our office say hello to our remote workers when they see they’re Google Hanging out. I feel that the perception of remote working as bad comes from a barrier to communication. If four people are in a room and the boss wants to notify them of something, the boss walks in, says it, and off they go. If the whole team is remote, you send an email, but who knows if they read it or when. If the whole team is on a persistent Google Hangout, the boss can join, say their piece, and be off. No problem. There’s no chance of thinking that our remote worker is slacking off because they’re there, working all the time. Whether they’re looking at Facebook or watching March Madness without us knowing is irrelevant, and isn’t solved by putting people in an office.

Is this a perfect solution for our team? It’s pretty close! We’ve got a good team to begin with, so remote work has never been an issue—the easier communication is just an added bonus. Given that, as someone who occasionally wants to work remotely, the ability to do so with more confidence, happiness from my managers, and being better able to support my team make it something definitely worthwhile.

My Shell and Bash Prompt Configuration

I use Bash every day in my work and at home on projects and I find the default setup of the system to be cumbersome. Call me a geezer, but I missed my dos-style information on the command line. I’ve replicated some of that in the following way:

This is in my ~/.profile file
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/|\1/'

This code provides a pwd in green and then a simple > character to indicate where your command line begins. This is easy enough to customize — replace the > with a $ if you like that, or change the color with something other than 0;32m.
Then, it creates a pipe and the current git branch (if available)

from arwin.net

abe hassan | blog: off by one on purpose

Here are two problems that we ran into at LiveJournal: In a paginated system, how do you know whether to display the next/previous links? With password prompts being masked out, how can you tell a user that they kept typing but the prompt didnt record more? In the first case: if you display 20 items per page, load 21. If you have 21, throw out the last one and add the pagination links. If you get 20, then you know its exactly right. Doing a database query with a "LIMIT 20" doesnt give you enough information to do this.In the latter case, its also easy: if your system limits passwords to say 15 characters, then make the change-password prompt take 16 characters. If the person typed in exactly 15 characters, then youre great. If you got 16, you can tell them that you didnt save their password the way they think you did.I love this idea. In order to gain certainty about something, you might just need one more piece of information. This trick is a bit clever and comes up every so often.

via abe hassan | blog: off by one on purpose.