Skip to content

Instantly share code, notes, and snippets.

View jwerre's full-sized avatar
🏠
Working from home

Jonah Werre jwerre

🏠
Working from home
View GitHub Profile
@jwerre
jwerre / negative look-ahead regex search
Last active August 29, 2015 14:20
MongoDb negative look-ahead regex search test
@jwerre
jwerre / tooltip.styl
Created November 3, 2012 23:42
tooltip written in stylus
.tooltip
display: inline-block
position: relative
margin-left: 5px
vertical-align: baseline
width: 14px
height: 14px
cursor: pointer
.tip
display:none
@jwerre
jwerre / Match block level html tags
Created November 8, 2012 23:58
Match all block level html tags
str.match(".*<(address|blockquote|div|dl|fieldset|form|h1|h2|h3|h4|h5|h6|hr|noscript|ol|p|pre|table|ul)>.*")
@jwerre
jwerre / template
Created November 21, 2012 19:54
replace bracketed numbers in strings with options
_.flatten( _.zip( def.split(/\{[0-9]\}/), options ) ).join(" ")
You've just sent an email template with Handlebars
This email was sent to {{email}}
{{#if amazing}}
You are amazing!
{{else}}
You did it!
{{/if}}
<h1> You've just sent an HTML template with EJS</h1>
<p> This email was sent to <a href="mailto:<%= email %>"><%= email %></a> </p>
<% if (amazing) { %>
<p>You are amazing!</p>
<% } else { %>
<p>You did it!</p>
<% } %>
You've just sent a plain text email with Underscore
this email was sent to <%= email %>
<% if (amazing) { %>
You are amazing!
<% } else { %>
You did it!
<% } %>
<h1> You've just sent an HTML template with Underscore</h1>
<p> This email was sent to <a href="mailto:<%= email %>">email</a> </p>
<% if (amazing) { %>
<p>You are amazing!</p>
<% } else { %>
<p>You did it!</p>
<% } %>
<h1> You've just sent an email template with Handlebars</h1>
<p> This email was sent to <a href="mailto:{{email}}">email</a> </p>
{{#if amazing}}
<p>You are amazing!</p>
{{else}}
<p>You did it!</p>
{{/if}}
h1 You've just sent a Jade email template from URI
p this email was sent to
a(href="mailto:"+email)=email
if amazing
p You are amazing!
else
p You did it!