Proteins, Code & Fashion

month

March 2013

1 post

Using Sentry/Raven.js with AngularJS to catch exceptions

AngularJS makes it easy to override their default exception handler. This means we can plug in Raven-js to send all client exceptions to Sentry :)

Just create your own module and service with the same name as the default AngularJS provider ($exceptionHandler):

angular.module('myExceptions', []).factory('$exceptionHandler',
          ['$window', '$log',
  function ($window,   $log) {
    if ($window.Raven) {
      console.log('Using the RavenJS exception handler.');
      Raven.config('YOUR_PUBLIC_DSN').install();
      return function (exception, cause) {
        $log.error.apply($log, arguments);
        Raven.captureException(exception);
      };
    } else {
      console.log('Using the default logging exception handler.');
      return function (exception, cause) {
        $log.error.apply($log, arguments);
      };
    }
  }
]);

Just get your proper Sentry public DSN and add your allowed domains in the Sentry security settings for your app.

Mar 28, 20130 notes

November 2012

1 post

Mac OS X dock hiding speed!

If you want to increase the speed that the dock hides and shows, and remove the delay so that you don’t waste those precious milliseconds, copy/paste these commands into your terminal:

defaults write com.apple.dock autohide-time-modifier -float 0.05
defaults write com.apple.dock autohide-delay -float 0
killall Dock

You now have a fast hiding dock!

Nov 22, 20121 note
#macs #tweeks #tech

July 2012

1 post

The scientific communication revolution: Why disrupt the scientific publishing industry?

In December of 2010, NASA published a paper in Science (Wolfe-Simon et al. 2010, A Bacterium That Can Grow by Using Arsenic Instead of Phosphorus.) in which they claimed to have isolated bacteria that substitutes arsenic for phosphorus on their macromolecules and metabolites. Of course, the implications of this finding would have been immense… had it been true. Soon after publishing, Dr. Rosie Redfield presented meticulous criticism of the original paper on her Wordpress blog (http://rrresearch.fieldofscience.com/2010/12/arsenic-associated-bacteria-nasas.html), and was essentially shunned by the NASA group, citing the non-official nature of her blog. It took one whole year for Dr. Redfield to submit her rebuttal paper to Science (http://rrresearch.fieldofscience.com/2012/01/arseniclife-manuscript-has-been.html), and five months more for her manuscript to be accepted for publication. Overall, it took one year and a half for traditional publishing to catch up to a Wordpress blog.

If there’s one thing in this world that needs to die and be reborn it’s the scientific publishing industry. One hundred years ago, the centralization of scientific publishing was necessary because content distribution was a hard problem. Now, as we all know, the problem of freely distributing content has largely been solved by the internet. Scientific publishing, as it stands today, is actually a hindrance to scientific progress. I’m not talking about the scientific method here, but purely the mechanisms by which we organize, compile, and distribute the vast amounts of scientific information.

Science is an old world institution where credit and reputation come mostly from journal article authorships. You can tell how well a scientist is performing by looking at their list of publications and by calculating something called an “impact factor”. An impact factor gauges the importance of a paper by calculating the number of times it is cited in the two year period after it is published. This is kind of like looking at the financial statements of a business. Both scientists and businesses require money to fuel their operations, and both must generate value from the fuel. In business, this value is typically represented by money. In science, value is knowledge in the form of publications. As a result, science has developed a strong dependence on the academic publishing industry. Over the past half-century, publishers have leveraged this dependence to build up the $20 billion scientific publishing industry that exists today.

Unfortunately for science, the traditional publishing model has become costly, painfully slow, and inefficient. It can cost anywhere between $1000-$5000 to have a paper published and even more (upwards of $8000) to publish an Open Access paper (free to read without a subscription). It can take up to a year for a paper to become accessible to subscribers (and/or the public) as it goes through the drawn-out publishing process. I’d venture to say that, because of this process, the vast majority of papers that come out today report on data that’s over a year old. Scientists are busy people, but they do most of the heavy lifting throughout the process. In academic publishing, unlike many other industries, the two most important inputs are provided virtually free of charge by researchers. Publishers argue that they add value by supporting peer review, typesetting, printing, and web publishing. The reality is that their main role is in representing their brand (the journal’s brand). All other processes can be fully automated over the internet (and they basically are already!).

As a way of mitigating the costs of publishing, some fields such as physics and math have collectively decided to bypass traditional journals altogether and use Open Access “e-print archives” such as arXiv.org. But, biologically-oriented fields are way more stubborn, most likely because of how afraid many researchers are of being scooped and the potential for valuable intellectual property. They’ll be sticking with traditional publishers until a reliable and trustworthy alternative comes along.

Between the rise of Open Access publishing houses and preprint servers such as PLoS and arXiv, and the more recent global boycotts of specific publishers (http://thecostofknowledge.com/), a lot of change is starting to happen. Many people have written about this issue (http://michaelnielsen.org/blog/is-scientific-publishing-about-to-be-disrupted/, http://www.nytimes.com/2012/02/14/science/researchers-boycott-elsevier-journal-publisher.html, http://scholarlykitchen.sspnet.org/2010/01/04/why-hasnt-scientific-publishing-been-disrupted-already/) and awareness is growing, but the future of scientific communication has yet to be discovered.

Jul 24, 20121 note
#science

June 2012

5 posts

Jun 13, 20121 note
How to get fashion advice from Google

You know what’s fun? Google Insights for Search. That’s what’s fun. You know what else is fun? Asking google for fashion trend advice. It’s fun because it’s kind of like asking Ronald McDonald for cooking tips.

Here’s what’s happening with “hawaiian print”:

In the #menswear world, you might think that everyone’s wearing Hawaiian prints. Maybe that’s true in that world, but if we venture out into the mass market it looks like Hawaiian print was hot in 2004… and kind of died off since then. As we might expect, it seems to peak mid-summer, every summer.

How about “camo pants”:

Camo pants are strange because there are all kinds of people that wear them, so it’s not as easy to know if they are actually “in style” or not… BUT here’s the kicker. Camo pants usually peak in the fall/winter season. This year the peak has turned into a plateau! Camo pants (or camo everything!) might actually be in style this summer!

Here’s a cool one, “selvedge denim”:

Now there’s a positive trend. Pretty clear that lots of men are finding out about selvedge denim these days. That’s cool.

Ok, so here are the last two interesting ones. Bow ties. Are they back in style or not?

Yes. Searches for bow ties are the highest ever in history (well, since 2004 to be specific). Bow ties are clearly coming back, at least for the time being.

One extra little thing I thought was interesting was the data on “how to tie a bow tie”:

Once again, a slight increase in the past couple of years… but what the hell are those peaks in December? WHAT IS HAPPENING IN DECEMBER? Someone please tell me… Christmas? what is it?

That’s all for today folks!

Jun 13, 20125 notes
#google #fashion #trends #charts #tech
Today is World IPv6 Launch day, and I predict...

In the next 10-20 years, every baby born in the developed world will be allocated their own personal IPv6 address.

Why? Well, wouldn’t it be cool if everyone just had the same phone number for life? Fine, so there are services like Google Voice and the Yellowpages but come on, how many people actually use these things in real life? Instead, what if everyone just had a single address that they could link to their phone, computer, computer-phone, brain-implant-phone, tooth-implant-phone, eyeball-phone, or whatever you might have in your pocket in 10 years, to your personal IPv6 number!? Think about the possibilities!

Also.. IPv6 also has cool integrated security features that should make the world a better place.

Today is dedicated to IPv6 Launch Day and Giant Steps by Coltrane.

Jun 06, 20120 notes
#geek #ipv6 #predictions #tech
Ringing a bell in your browser through WebSockets

Today at Dolbeau I wanted to make a bell ring when a new order comes in… just like Jeff Bezos did in the early days of Amazon. I wanted to make sure that our bell rings in any browser that has the bell page open. It turns out it’s super easy to do using NodeJS/Express and Socket.IO.

This is how it all works:

  1. Load the URL in any number of browsers
  2. Send a POST to the same url
  3. Listen to the bell ring in all open browsers!

Also you can specify which sound you want to play by using the ‘type’ POST parameter. Just check out the JS and HTML files and you’ll be good to go!

Fork it on GitHub!

Jun 05, 20123 notes
#nodejs #web #programming #hacks #tech
Jun 02, 20123 notes
#japan #dolbeau #google

May 2012

5 posts

May 31, 20121 note
#fashion
May 30, 20121 note
#fashion
May 11, 20121 note
#dolbeau #tech
May 10, 20120 notes
#fashion
May 02, 20120 notes

April 2012

9 posts

Apr 30, 201227 notes
Apr 28, 20121 note
#dolbeau #stats #tech
Apr 27, 2012148 notes
#menswear #dolbeau #fashion
Apr 25, 20122 notes
#dolbeau #tech
Provision & deploy a simple Django stack on Debian 6 using Fabric & Cuisine

Warning: This post is for people who know what Python, Django, and Debian are.

It turns out that most people ever only need a single VPS node (or less) for their Django site. When it comes to small sites, using Chef and Puppet for deployment is kind of overkill. In our previous iteration at Dolbeau I implemented Chef with the Deploy Resource. It worked alright, except for the fact that my deploys took way too long, not to mention it was super overcomplicated and scary when it failed. I wanted to convert my huge ass Chef deployment into a tiny Fabric script (with the help of Cuisine), so I did!

You can find it in a Github repo called deploy-django.

The stack is composed of:

  • Nginx
  • Gunicorn
  • Django
  • Memcached
  • Postgresql

Supervisord is basically optional, but you need to edit the fabfile. Right now I personally just restart guncorn using a kill -HUP during the deploy process. This seems to work fine for my purposes. I’ve included an example init script in the provision folder.

To use the fabfile, you first need to install the requirements:

pip install -r requirements.txt

Then, edit the deploy_settings.py file:

APP_NAME = the name of your python app
APP_REPO = the git repo
APP_REPO_BRANCH = the branch you want to deploy
APP_HOSTS = a list of hosts
REMOTE_USER, REMOTE_GROUP = the linux user that should own the deploy directory on the server

DJANGO_STATIC_ROOT = the directory name of your static_root in your app
DJANGO_MEDIA_ROOT = the directory name of your media_root in your app

DEBIAN_PACKAGES = a list of debian packages to install, the default list contains a bunch of things that you may not need

DEPLOY_TREE = defines the deploy directory tree. The default deploy tree creates a /srv/<APP_NAME> for your app.


DEPLOY_TREE = {
    APP_NAME: {
        'releases': {},
        'shared': {
            'logs': {},
            'media_root': {},
            DJANGO_STATIC_ROOT: {}
        }
    }
}

Then, you edit the server config files in the provision directory. The provision directory is structured as if it is the root directory of your server’s disk and it contains basic config files for your stack. You will need to edit these files (and rename some of them) before trying to deploy, they are NOT templates.

/etc/
    rc.local
    init.d/myapp
    gunicorn/myapp.conf.py
    nginx/
        nginx.conf
        sites-available/myapp
    postgresql/8.4/main/postgresql.conf
    supervisor/conf.d/myapp.conf
/srv/myapp/shared/settings_local.py

Then you can try to initialize, provision and deploy:

fab initialize

This will set up the required user and inject your public ssh-key for passwordless login.

fab provision

This will install the packages and set up the server config files

fab deploy

This will deploy your app!

It should all work… if it doesn’t then feel free to file an issue or fork the repo.

Apr 25, 20122 notes
#python #django #deploy #geeks #tech
Apr 19, 201214 notes
#fashion
Apr 19, 20121 note
#fashion
Apr 16, 20120 notes
Apr 06, 201259 notes
#Dolbeau #fashion

March 2012

3 posts

Mar 10, 201244 notes
#dolbeau #ties #menswear #fashion
Mar 08, 20120 notes
Mar 02, 20122 notes

February 2012

19 posts

Feb 28, 20121 note
Feb 27, 20121 note
#fashion
Feb 26, 20122 notes
#fashion
Feb 25, 20120 notes
“Every bed is made with a unique machine. It has five fingers and is better known as a hand.” —Hästens beds booklet
Feb 25, 20120 notes
#hastens #marketing #handmade
Why building a brand is hard as hell.

Brands are all about emotion (duh!). It’s funny because when you’re working on a startup that designs, manufactures, and sells mens accessories, it’s really easy to forget that simple fact. Especially when the company basically consists of a handful of people doing all kinds of random shit. Also, I have to admit that sometimes I’m just not that good at emotions.

Think about Tiffany & Co for a second. Tiffany’s makes you think of love. Not just any love mind you… true love. The only love that’s worth loving for… obviously. That’s what they’re about! They even have an entire website about true love (http://www.whatmakeslovetrue.com/). I bet you didn’t know that! So what that they’ve been around since 1837… I’m pretty sure love has been around for longer than that. You have to hand it to them though… they really kill it with their branding.

Now, back to reality. The challenge with a new company is that the possibilities are endless. We can do whatever the fuck we want! Sounds fun in theory but it really isn’t easy for a control freak like myself :) At some point a decision has to be made about the central “tenet”, or to be super nerdy, the prime directive of the business. If you can pick 1-3 words that describe the emotion of your business, what would they be?

At Dolbeau, we’ve made some mistakes and we’re still working it all out (as we should be), but we have a pretty good idea of where we want to go. We think we can be pretty funny dudes sometimes, but we’re also deadly serious. So there you have it: serious, with a side of funny. There has to be a better way to phrase it though… but we’re making baby steps here.

Feb 25, 20128 notes
#branding #marketing #dolbeau
Feb 24, 20120 notes
Feb 15, 20120 notes
Feb 14, 20121 note
#fashion
Feb 05, 20123 notes
#BMW
Feb 04, 20120 notes
#monkey #animals
Feb 04, 20125 notes
#trains
Feb 03, 20122,247 notes
#fashion
Feb 03, 20120 notes
Feb 03, 20124 notes
#paris
Feb 02, 20120 notes
#berlin
Feb 02, 20120 notes
#copenhagen
Feb 01, 201221 notes
#boat #burma #myanmar #fishing
Feb 01, 20120 notes
#flying #parachuting

January 2012

9 posts

Jan 31, 201239 notes
#industrial
Jan 31, 20129 notes
#2002tii #bmw #desert
Jan 30, 20125 notes
#proteins #nerdy #science
Jan 30, 20122 notes
#army #water
Jan 30, 201240 notes
#rust #superfluous #fashion
Jan 20, 20122 notes
#Dolbeau
Next page →
2012 2013
  • January
  • February
  • March 1
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
2011 2012 2013
  • January 9
  • February 19
  • March 3
  • April 9
  • May 5
  • June 5
  • July 1
  • August
  • September
  • October
  • November 1
  • December
2011 2012
  • January
  • February
  • March
  • April
  • May
  • June
  • July
  • August 24
  • September 13
  • October 7
  • November 5
  • December 4