Skip to content

Instantly share code, notes, and snippets.

@mrmch
mrmch / ampjack.dml
Created September 19, 2022 16:59
Blackjack in Email with DML + AMP
<dys-block>
<dys-row>
<dys-column>
<dys-html>
<div class='modal' id='modal'>
<div class='modal-content'>
<dys-img padding='0' padding-top='60px' ratio='200:51' src='https://cdn.assets.dyspatch.io/security=policy:eyJjYWxsIjpbInJlYWQiLCJjb252ZXJ0Il0sImV4cGlyeSI6MjE0NzQ4MzY0NywiaGFuZGxlIjoiSmc4MWFWUllSWjZuMFJibmxXWVAifQ==,signature:5d81e5ea2ca9e035c79363a8d39722bbe62d147535260122cb50f4ff663c36b4/Jg81aVRYRZ6n0RbnlWYP' width='200px' />
<dys-img id='ampjacklogo' padding='0' src='https://cdn.assets.dyspatch.io/security=policy:eyJjYWxsIjpbInJlYWQiLCJjb252ZXJ0Il0sImV4cGlyeSI6MjE0NzQ4MzY0NywiaGFuZGxlIjoicEQ5bVdhRm9UNzY0eXJhbTkwZFQifQ==,signature:6e814ec4bd377f691eb8a44106bae9bb24eb023d081941ae06e82fd9651ccab8/pD9mWaFoT764yram90dT' width='250px' />
<button class='myButton' id='startButton' on='tap: modal.toggleClass(class = "modalContentErase", FORCE=true), reset.clear, nameForm.show, stayForm.clear, hitForm.clear, startButton.hide' style='margin-left: 2
# map specific drip campaigns to email addresses
drip_campaign_map = {
"matt+d1@sendwithus.com": "dc_ZLc2i7ebzzcnYAPKWEcTWh",
"matt+d2@sendwithus.com": "dc_KN9qPMGMaS4sSntT9yzzA9"
}
try:
drip_id = drip_campaign_map[input['to']['email']]
return [{'email': input['email'], 'drip_id': drip_id}]
except:
pass

Keybase proof

I hereby claim:

  • I am mrmch on github.
  • I am mrmch (https://keybase.io/mrmch) on keybase.
  • I have a public key whose fingerprint is 031B 042C C7B6 3AA9 C082 5934 356A 98B6 8D89 1486

To claim this, I am signing this object:

@mrmch
mrmch / angellist.css
Last active January 29, 2016 01:09
Hide candidate pictures and names on AngelList
div.candidate-picture {
display: none;
}
.js-browse-table-row-name {
display: none;
}
@mrmch
mrmch / vim_session_tab_complete.zsh
Created July 27, 2015 22:09
zsh function to tab complete opening vim sessions
compdef '_files -g "*.vim" -W ~/.vim/sessions' vs
vs() {
# optional: use $EDITOR instead of mvim (assumes one of vim/gvim/mvim)
# $EDITOR -S ~/.vim/sessions/$1.vim
mvim -S ~/.vim/sessions/$1
}
@mrmch
mrmch / data setup
Created August 12, 2014 19:12
data setup
{
"Behavioral Specialist": [
"Animnal Behaviour Specialist Position",
"Junior behaviour science intern",
"Senior Behaviour Analyst (full time)"
],
"Behavioral Health": [
"..."
]
}
fname = 'NAICS.txt'
ofname = 'NAICS_FIXED.txt'
with open(fname, 'r') as ifile:
with open(ofname, 'w') as ofile:
for line in ifile.readline():
parts = line.split(":")
if len(parts) > 2:
# we have a partial
next_line = ifile.readline()
{% if city == "berlin" %}
The best restaurant in Berlin is Lorenz Adlon Esszimmer, located in the famous Adlon Hotel.
{% elif city == "london" %}
The best pub in London is The Mayflower, one of the oldest establishments on the river Thames.
{% elif city == "vancouver" %}
The best sushi restaurant in Vancouver is Tojo's, famous for its omakase ("leave it up to us") dinners.
{% else %}
Voted the top restaurant in the world, El Celler de Can Roca in Girona, Spain, is famous for its charcoal-grilled king prawn.
{% endif %}
// 1) Set your API key
string api_key = "YOUR API KEY";
// Let's create a request
string url = "https://api.sendwithus.com/api/v1_0/send";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
httpWebRequest.ContentType = "text/json";
httpWebRequest.Method = "POST";
// set headers with api key