Sublime Text 2 Is Awesome

2012.08.09

I forgot to mention that I have recently switched my text editor to Sublime Text 2.

At first glance it is very much like Vico and TextWrangler, but there is one extension that makes it much more unique.

Once you install Package Control, the editor transforms into a power-house. The idea is very similar to Coda‘s Plugin manager, but with a different approach.

The editor is rails friendly and much needed VI extension is available through VintageEx.

Other cool extensions for Sublime Text 2 include: HTML2Halm, CoffeeScript, Coffee Compile… and you can find more packages here.

Simulating Low Bandwidth For Local Web Development

2012.06.29

It is important to know how a webpage would load on another person’s computer, especially when it involves AJAX and page scripting. It may work properly and load as fast as it is, this is not the case on another machine with another configuration. Therefore, it is essential to be able to simulate network loadtimes, latencies and packet losses. Here I will be giving simple examples and how to setup a low-bandwidth environment on Mac OS X and other Unix/Linux systems.

OS X is equipped with some powerful tools. Not to mention that it comes with a built-in Apache and PHP, it also comes with a number of security tools including IPFW. IPFW is a tool that is essential to control the inflow and the outflow of traffic on your machine. When you access the firewall settings from your System Preferences application, it configures IPFW to monitor the network. System Preferences is the front-end GUI for IPFW, so to speak. Since System Preferences is not powerful enough, we will be using the Terminal.

Setup

The plan of action is the following:
open port 8080 with a limited bandwidth and redirect requests made to it to the local web server (port 80).

The following command would open port 8080 and redirect its requests to our webserver, which runs on port 80:

sudo ipfw add 200 forward 127.0.0.1,80 ip from any to any 8080 in

Now, we have to run the requests made to port 8080 through a pipe:

sudo ipfw add 205 pipe 50 ip from any to 127.0.0.1 dst-port 8080

and configure the pipe to lower bandwidth at 64Kbps:

 sudo ipfw pipe 50 config bw 64Kbit/s

With these three easy commands, we have created port 8080, which will serve the same content as the default webserver, but at a lower rate. If you direct your browser to

http://localhost:8080/

, you will notice a significant web page load time change compared to

http://localhost/

(assuming your web server runs on port 80).

Latency and Packet Loss

In terms of having a more realistic simulation, there are two other aspects to networking: latency and packet loss. And it is a matter of how you configure your pipe. The following command will add 300ms latency with 10% packet loss on a 64Kbps pipe:

sudo ipfw pipe 50 config delay 300ms bw 64Kbit/s plr 0.1

Removing Rules

To remove your port 80, you simply have to remove the rules you have set. Rule # 200 and 205 will be removed with the following commands:

sudo ipfw delete 200<br />sudo ipfw delete 205

Once deleted, the browser will give you an error when you try accessing port 8080 because it will no longer redirect your traffic. If you want to see that the rule was actually deleted, type in the following:

sudo ipfw list

and you will see that rule 200 and 205 have been baleeted.

Also note: If you are loading jQuery or other scripts from external sites, this simulation will not work because you are not putting any restrictions on outside sources.

Please leave a comment if you know of a better, cooler way to simulate loading on your local machine.

Categories : Programming

How to build Apps

2011.05.08

The ‘Facebook Class’ Built Apps, and Fortunes – NYTimes.com:

The students ended up getting millions of users for free apps that they designed to run on Facebook. And, as advertising rolled in, some of those students started making far more money than their professors.
They had stumbled upon one of the themes of the class: make things simple, and perfect them later.

`Keep things simple, and perfect them later,` but don’t you need perfection to some extent not to bum out your users?

User Interface

2010.11.09

“[UI] is an interface between a human and a database. You can’t have an interface unless you can connect to both things.”

from an interview with Ryan Singer.

via. The Web Practitioner’s Blog

If you have a beautifully connecting program to a database but your UI is ugly, then you don’t have a program, but garbage.

Tags :       

Douglas Rushkoff: Program or be Programmed

2010.10.13

Program or be Programmed: Ten Commands For A Digital Age is a new book by Douglas Rushkoff published by OR Books where Douglas presents his guidelines for humanity’s role in the future of technology.

The debate over whether the Net is good or bad for us fills the airwaves and the blogosphere. But for all the heat of claim and counter-claim, the argument is essentially beside the point: it’s here; it’s everywhere. The real question is, do we direct technology, or do we let ourselves be directed by it and those who have mastered it? “Choose the former,” writes Rushkoff, “and you gain access to the control panel of civilization. Choose the latter, and it could be the last real choice you get to make.” In ten chapters, composed of ten “commands” accompanied by original illustrations from comic artist Leland Purvis, Rushkoff provides cyberenthusiasts and technophobes alike with the guidelines to navigate this new universe.

In this spirited, accessible poetics of new media, Rushkoff picks up where Marshall McLuhan left off, helping readers come to recognize programming as the new literacy of the digital age––and as a template through which to see beyond social conventions and power structures that have vexed us for centuries. This is a friendly little book with a big and actionable message.

via Laughing Squid.

Tags :     

NELL Learns to Read the Web

2010.10.12

NELL (Never-Ending Language Learning) is a system developed at Carnegie Mellon which is taught to “learn” the web. I guess this is a successful project, something which I had worked on several years back with the idea that everything is related to everything else. Here is what they say about themselves:

Project Overview: To build a never-ending machine learning system that acquires the ability to extract structured information from unstructured web pages. If successful, this will result in a knowledge base (i.e., a relational database) of structured information that mirrors the content of the Web.

Their goal is to construct a knowledge base or relational data. I wonder what use it could be without a parser… Stay tuned, might be the next big thing.

You can also follow the machine twitter… @cmunell.

via Read the Web :: Project Overview.

HTML5 Boilerplate

2010.10.07

HTML5 Boilerplate is the professional badass’s base HTML/CSS/JS template for a fast, robust and future-proof site.

via HTML5 Boilerplate.

Aspect-Oriented Programming with jQuery

2010.10.06

The jquery-AOP project used jQuery to create functions that can treat object methods and global functions as aspects. That means, that you can run other code before, after, or around them.

For example, let’s say you want a pop-up message box to appear before someone uses the document check-out feature.

via EndUserSharePoint.com.

Interview with Chatroulette’s Founder, Andrey Ternovskiy

2010.07.27

Andrey Ternovskiy Himself

Seems like a smart kid. Some interesting excerpts from his letter:

“I was and still am a teenager myself, that is why I had a certain feeling of what other teenagers would want to see on the Internet.”

“I have been coding since 11.”

“I never thought that handling the heavy user load would be the most difficult part of my project.”

“I’d love to share work with someone else [...] most of the interested people are located far away from me, because I live in Moscow. So I still have to do all the things myself.”

“I actually think that it would be best to found Chatroulette as a U.S.-based company.”

“I chose Germany for hosting, because it is in the middle between Russia and U.S.A. It is also at the center of various backbone European networks. I think this is a good place for hosting a project which connects people around the world with each other.”

“I am not even sure what Chatroulette is now. Everyone finds his own way of using the site. Some think it is a game, others think it is a whole unknown world, others think it is a dating service.”

Would love to take a look at his website and his other projects.

Keep up the good work, Andrey!

via New York Times

Radio Krayany Migration: Still Beta

2010.07.08

The system has been migrated from mpd to liquidsoap. Much easier configuration and setup. Very flexible and will be hosting scheduled events and scheduled programming.

Still testing for stability…

http://radio.yurikoval.com