Skip to Main Content

Advice from Peter Thiel's Zero to One

"Remember that your founders are your family, give great employees limited tasks, start with ambitious yet small products that dominate a narrow market, stop hating on salespeople, and focus on a corporate thesis statement, or "secret," that distinguishes you from your rivals."

 

 

Laravel: Access the Logged-in User's ID in Your Master Pages

If you are searching for a way to access the current user's ID in you master pages, adding a view creator to your BaseController does the trick. This will make the variable $current_user available in all master pages contained in the views/layouts directory.

class BaseController extends Controller {
    protected function setupLayout() {
       
View::creator('layouts.*', function($view) {
          $view->with('current_user', Auth::id());
        });
       if ( ! is_null($this->layout)) {
          $this->layout = View::make($this->layout);
       }
    }
}

Create a Personal Dropbox with BitTorrent Sync

tldr;

This one-line installer will automatically configure a remote BitTorrent Sync server.

Check out the Project on GitHub

Why set up a BitTorrent Sync server?

Unlike Dropbox, BitTorrent Sync doesn't sync to a central server. The upside is that it's not putting your data in the cloud. That's a huge upside.

The problem is that you are only be able to sync if the computer you're syncing with is turned on and connected to the internet. If you sync your iPhone with a laptop, but the laptop is closed, you won't be able to sync. Or if you sync your laptop with your office work station, and someone turns off the workstation after you leave the office, you won't be able to sync.

Syncing to a remote server creates a more Dropbox-like experience, because your files are always accessible (but only those files you selectively choose to put in the cloud!). 

What is BitTorrent Sync?

For the uninitiated, BitTorrent Sync is similar to Dropbox in that it lets you sync files across multiple computers. It has several major benefits over Dropbox:

  • BTSync is insanely fast.
  • It does direct computer-to-computer syncing, so your data doesn't have to go into the cloud.
  • It's not one-to-one: you can sync any directories on any computers with any other directories on any other computers.
  • BTSync can do read-only syncing, which is great if you need to distribute files.
  • You can sync with a web server to automatically deploy changes without ftp or ssh.
  • It can handle huge files, like HD video, i.e. you can sync directly with your editor while you're out on location.
  • It uses your local network when possible, rather than going out over the public internet, making it both faster and more secure.
  • It's open source.

There's more cool stuff, so check it out!

MYSQL ERROR 1005: Can't create table (errno: 150) :: InnoDB

Both tables must be INNODB. The foreign key field must have an index. The foreign key field and the field being referenced must be of the same type. If fields are integer (typical) they must be unsigned.

Deploying LAMP on CentOS 6.5

I've been updating my series on CentOS deployment for version 6.5, with some additional security steps and some notes for Linode. Hope you enjoy.

Wisdom from the Dude

Open at your own speed, but open.
Dig what's happening to you.
By "dig" I mean get into it. There are lessons for you there. And when it gets uncomfortable, that's an important time to open and dig. There's treasure in them thar hills.

realjeffbridges

Solutions...

This is how I feel about regex...

"XML is like violence - if it doesn’t solve your problems, you are not using enough of it."

Most RecentRSS

ArchiveRSS

March 2016 (1)
January 2016 (1)
September 2015 (1)
May 2015 (1)
April 2015 (1)
March 2015 (1)
February 2015 (2)
January 2015 (5)
September 2014 (2)
August 2014 (4)
July 2014 (1)
March 2014 (1)
November 2013 (3)
September 2013 (3)
July 2013 (6)
June 2013 (1)
May 2013 (1)
March 2013 (2)
February 2013 (3)
January 2013 (4)