Skip to content

Instantly share code, notes, and snippets.

@benmann
benmann / gist-embed.txt
Created January 27, 2022 09:10
Embedding a Gist on allround.io
<Gist url="username/id" file="filename.js"></Gist>
Building wheels for collected packages: Pillow
Building wheel for Pillow (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python@3.9/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/gg/yh3zn7bj3bxdcjbr_pxd83gr0000gn/T/pip-install-owbffvvx/pillow_10790c45ac71441483202a3eaecf6f14/setup.py'"'"'; __file__='"'"'/private/var/folders/gg/yh3zn7bj3bxdcjbr_pxd83gr0000gn/T/pip-install-owbffvvx/pillow_10790c45ac71441483202a3eaecf6f14/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/gg/yh3zn7bj3bxdcjbr_pxd83gr0000gn/T/pip-wheel-u1q9uo3c
cwd: /private/var/folders/gg/yh3zn7bj3bxdcjbr_pxd83gr0000gn/T/pip-install-owbffvvx/pillow_10790c45ac71441483202a3eaecf6f14/
Complete output (174 lines):
/usr/local/lib/python3.9/site-packages/setuptools/dist.py:634: UserWarni
@benmann
benmann / mail.html
Created August 17, 2019 09:51
mail-template
<style>
h2 {
line-height: 1;
font-size: 25px!important;
}
h2 a {
display: block;
text-transform: capitalize;
color: #5AA2F1 !important;
font-size: 25px!important;
@benmann
benmann / gist:e639241b82fc9d96216d71f93510dcd3
Created December 21, 2017 10:33
Replace locaStorage in IE for file://
localStorage = {
setItem: function(item, value) {
this.localStorage[item] = value;
},
// ...
}
getParam: function (name, url) {
if (!url) url = location.href;
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)",
regex = new RegExp(regexS),
results = regex.exec(url);
return results === null ? null : results[1];
}
addOrUpdateUrlParam: function(uri, paramKey, paramVal) {
var regex = new RegExp("([?&])" + paramKey + "=[^&#]*", "i");
if (regex.test(uri)) {
uri = uri.replace(regex, '$1' + paramKey + "=" + paramVal);
} else {
var separator = /\?/.test(uri) ? "&" : "?";
uri = uri + separator + paramKey + "=" + paramVal;
}
if (history.pushState) {
// HTML
<a href="#" class="lazyimage">
<div class="placeholder" data-large="fullsize.jpg">
<img src="small.jpg" class="img-small">
<div style="padding-bottom: 39.47%;"></div>
<!-- % calculated from ratio eg. 450/1140px -->
</div>
</a>
@benmann
benmann / client.js
Last active December 31, 2015 14:52
Wrapping cookiejar DB requests in falcor router
// Client side JS looks like this
model.get("packagesByName.jquery.url").then(function(response) {
// returns: git://github.com/jquery/jquery.git
document.write(response.json.packagesByName.jquery.url);
});