Skip to content

Instantly share code, notes, and snippets.

Evan Haveman emh

Block or report user

Report or block emh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am emh on github.
  • I am emh ( on keybase.
  • I have a public key whose fingerprint is 868F 95FA 4A0F 12D6 D8CF B181 A015 74A0 3833 02F2

To claim this, I am signing this object:

emh / gist:7441569
Created Nov 13, 2013
I wanted to use a bunch of underscore.string ( functions as filters in an AngularJS project and rather than writing separate filters for each function I came up with this.
View gist:7441569
* call titleize like:
* {{ expression | _str.'titleize' }}
* call truncate like:
* {{ expression | _str:'truncate':5:'...' }}
* etc.
app.filter('_str', function() {
return function(text, fn) {
var args =, 2);
emh / gist:329963
Created Mar 12, 2010
Javascript Partials - because I hate seeing HTML embedded in my Javascript code.
View gist:329963
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xml:lang="en" lang="en">
<title>javascript partials</title>
<script src="" type="text/javascript"></script>
function createHello() {
var name = $('#name_field').attr('value');
You can’t perform that action at this time.