Glenn Jahnke's blog



Glenn JahnkeGlenn Jahnke
Standup 1/9/2012
edit Posted by Glenn Jahnke on Monday January 09, 2012 at 09:48AM

Helps

CCMenu + Hudson w/o Basic Auth

"Has anyone figured out how to use CCMenu with Hudson and not have Basic Auth?"

Hudson has its own authorization mechanism, unlike Basic Auth, so it can't be used with nice desktop tools like CCMenu which shows the red/green square in your system tray.

Consider using Jenkins.

Using Symlinks with Dropbox

Using the Linux Dropbox client seems to allow symlinks to be uploaded, but they will not behave as expect anywhere else. Someone was trying to have a "latest" folder point to the latest versioned folder.

The recommendation was just to have two copies of the files as a workaround.

Interestings

Rails Bridge Outreach for Women Workshop has space

Looking to learn Rails? There's a great meetup to get you up and running. As of this writing there is still space available. Come check the event out.

Yammer Javascript Meetup on Tuesday

Yammer will be hosting a Javascript meetup, expect the usual snacks and beer, and good talks about our favorite client-side language.

Glenn JahnkeGlenn Jahnke
Polyglot Factorial
edit Posted by Glenn Jahnke on Tuesday November 15, 2011 at 09:35PM

Someone on Hacker News mentioned the number of orderings of a deck of cards. I took up the challenge in some of my favorite and not so favorite languages, I'll let you guess :).

Ruby

ruby-1.9.2-p180> (1..52).inject{|a,b|a*b} => 80658175170943878571660636856403766975289505440883277824000000000000

Scala

scala> BigInt(1).to(BigInt(52)).toList.foldLeft(BigInt(1))((a,b) => a*b) res23: scala.math.BigInt => 80658175170943878571660636856403766975289505440883277824000000000000

Haskell

Prelude> foldl1 (\x -> \y -> x*y) [1..52] 80658175170943878571660636856403766975289505440883277824000000000000

CoffeeScript

coffee> [1..52].reduce (a,b) -> a*b

8.065817517094388e+67

Java

Non-existent REPL> import java.math.*; public class Factorial { public static void main(String[] args) { BigInteger result = BigInteger.ONE; BigInteger fiftyTwo = new BigInteger("52"); for(BigInteger i = BigInteger.ONE; i.compareTo(fiftyTwo) <= 0; i = i.add(BigInteger.ONE)) { result = result.multiply(i); } System.out.println(result); } }

$ java Factorial 80658175170943878571660636856403766975289505440883277824000000000000

** I could have used the product function in most of those examples, but I wanted to play with foldL ;)

Glenn JahnkeGlenn Jahnke
Standup 2011.04.14 - Bustin' Caches, Pow, and Trajectory
edit Posted by Glenn Jahnke on Thursday April 14, 2011 at 09:23AM

Helps

Busting JS Caches Better

How do I bust Javascript caches better? Changing the url params doesn't always work?

The most consistent way to bust Javascript caches is to change the path to it. Sometimes transparent proxies and some browsers won't be busted otherwise.

Busting Chrome JS Cache when running Jasmine Fixtures

Chrome is cache Jasmine fixtures and Firefox is just too slow.

No great solution. Chrome typically runs tests so fast that just mashing the refresh until your test output changes seems to work for some.

Interestings

Trajectory

Trajectory is a new product out by Thoughtbot which has been described as a cross between Tracker and Basecamp.

Pow

37Signals has come out with a native Mac app called POW. Here's a snippet from the Readme:

Pow is a zero-configuration Rack server for Mac OS X. It makes developing Rails and Rack applications as frictionless as possible. You can install it in ten seconds and have your first app up and running in under a minute. No mucking around with /etc/hosts, no compiling Apache modules, no editing configuration files or installing preference panes. And running multiple apps with multiple versions of Ruby is trivial.

A fellow Pivot also mentioned that it makes running multiple apps on the same port, and having sub-domains easier.

Firefox cacheing

There is an option in Firefox to remember the last opened tabs so when you return to your browser, it will restore your last viewed websites.

This has the unfortunate side-effect of not deleting cookies despite the opposing setting for deleting all cookies upon session exit.

Glenn JahnkeGlenn Jahnke
Standup 2/17/2010: A New Jasmine Release
edit Posted by Glenn Jahnke on Wednesday February 17, 2010 at 09:14AM

Interesting Things

There is a new release of Jasmine, the Javascript testing framework written by several people here at Pivotal Labs, due to a bug found in CI related to implementing Rack.

For those uninitiated to Javascript BDD testing, here is a quick example.

it('should be a test', function () {
  var foo = 0
  foo++;

  expect(foo).toBeTruthy();
  expect(foo).toEqual(1);
});

Be sure to check out Jasmine at Github.