Web Development

HackNY Hackathon Starter Script

Posted in HackNY, PHP, Tips, Uncategorized, Web Development on April 8th, 2011 by j3nnings – Be the first to comment

My buddy Andrew wanted to be able to hack on something a tomorrow’s HackNY competition. He’s never used PHP before so I wrote him this file to help him make an api call and display it on a web page. I’m assuming that you’ve already got a PHP environment set up somewhere. If not, check out XAMPP.

This file is intended to give new programmers (hackathon or else) something to start hacking on quick. Of course, you would have already needed to set up PHP and a webserver.

This file just makes a simple api request and displays the response. The API for this example is embed.ly, an API for turning normal links (http://…) into embeddable widgets (video players, slideshows, etc) .

The actual code can be found here. you should copy and paste it into an index.php file in your htdocs directory (if using XAMPP).

CodeIgniter URL Rewrite with .htacccess AND populated $_GET variables

Posted in CodeIgniter, How To, PHP, Web Development on December 7th, 2010 by j3nnings – Be the first to comment

Everytime I start a new CodeIgniter project on Dreamhost I face the same two problems.

  1. How can I get URL rewriting to work properly?
  2. How can I repopulate $_GET variables once they are stripped by CodeIgniter?

The problem with this pair of tasks is that task 2 is dependent on how you solve task 1. I’ve solved both problems (on dreamhost) with the following fixes:

Make sure your config.php has these values set:

$config['base_url'] = "http://domain.com/";
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
$config['enable_query_strings'] = TRUE;

Your .htaccess looks like this:

RewriteEngine on
RewriteCond $1 !^(index\.php|public|favicon\.ico|static|robots\.txt)
RewriteRule ^(.*)$ /index.php?/$1 [L]

And add this to the top of any Controller you wish to use $_GET variables in.

function __construct() {
parse_str(substr(strrchr($_SERVER['REQUEST_URI'], "?"), 1), $_GET);
parent::Controller();
}

Now you’ll be able to access the $_GET variables as you would expect:

echo $this->input->get('foo');

Bit.ly Bundles

Posted in Articles, Bit.ly, Web Development on November 15th, 2010 by admin – Be the first to comment

Techcrunch did an early writeup on bit.ly bundles, a new product from bit.ly that I worked on all summer as an intern at Betaworks.

There is a simple rule on the Internet when it comes to passing links around: the easier it is to share links, the more links will be shared. Bit.ly and other URL shorteners proved this with their billions of links repackaged for a 140-character world. Later today or tomorrow, bit.ly will be introducing a new feature called bit,ly bundles which lets you shorten a bunch of links into one single bit.ly link. Don’t pretend like this isn’t your dream come true.

http://techcrunch.com/2010/11/15/bit-ly-bundles/

A couple days into my internship I was asked to help design a new product to share multiple bit.ly links. A couple days before my internship ended, I was demoing an early prototype of what you see here. 99% of my time in the betaworks office was dedicated to bundles. I feel like bundles was my baby, though I was not working alone. The prototype team consisted of Jason Morrow, Neil Wehrle, Nina Khosla, and myself. After my internship ended, the prototype was passed off to production.

Wish you could download the news into your brain while you slept?

Posted in Articles, Web Development on November 3rd, 2010 by j3nnings – Be the first to comment

Well you can’t do that just yet, but a Rutgers University college student may have invented the next best thing. Rooster.am is a crazy alarm clock, which not only wakes you up with “Cockle Doodle Doo” but also reads the news to you that you missed while you were sleeping. 20-year old hacker Ian Jennings unveiled his project to a group of 750 local tech enthusiasts at the monthly NY Tech Meetup.

http://thenextweb.com/apps/2010/11/03/rooster-am-a-crazy-new-alarm-clock-that-wakes-you-up-with-the-top-twitter-and-social-media-news/

Cock-a-doodle-doo to become a real web-app

Posted in Web Development on October 17th, 2010 by j3nnings – Be the first to comment

I am continuing development on my first place alarm clock hack from last weeks HackNY contest. Although still in-the-works, the app will be a full featured version of what you saw at the demo.

I’m going to be presenting the first public version of the app at next months NYTM on November 2nd. If you’d like to stay in the loop, just follow me on twitter.

Ventstatus.com, what it is and how it works.

Posted in CodeIgniter, Rant, Ventstatus.com, Web Development on October 15th, 2009 by j3nnings – Be the first to comment

Ventrilo is a VOIP or voice over internet protocol. In other words, it lets users chat with each other over the internet instantly. Ventrilo is known for its super high quality voice codecs, and for being simple and reliable. The difference between Ventrilo and something like Skype is that Skype creates a direct connection between two or more clients through a peer to peer network. Ventrilo, on the other hand, first gives this information to a server where it is then transmitted to everybody else connected to that server.

This method makes Ventrilo an attractive resource for gamers. The servers are more stable and more reliable than direct connections, and the voice quality is supreme. The program also happens to be very lightweight, as to not distract processing power from high performance games. Ventrilo is the choice application for gamers who want to talk to other gamers.

read more »

Find SQL Bottlenecks With CodeIgniter

Posted in CodeIgniter, How To, PHP, Web Development on April 6th, 2009 by j3nnings – 3 Comments

I have been using my latest project, VentStatus, as a an opportunity to learn a new framework: CodeIgniter. It has treated me well so far, most problems encountered only required a short workaround. Lately I’ve been concerned with the scale-ability of VentStatus, it’s my first project on this large of a scale. Luckily, CodeIgniter has some benchmarking classes built in, and it really helped me cut down my load times.
read more »