Skip to content

Instantly share code, notes, and snippets.

@jondcallahan
jondcallahan / mandrill-send.js
Created February 4, 2016 22:24
Send an html email from the command line via Mandrill. Useful for rapidly testing html emails.
var email = require('mandrill-send')('MANDRILL_API_KEY');
var fs = require('fs');
require.extensions['.html'] = function (module, filename) {
module.exports = fs.readFileSync(filename, 'utf8');
};
var htmlEmail = require("PATH_TO_FILE.HTML");
email({

Keybase proof

I hereby claim:

  • I am jondcallahan on github.
  • I am jondcallahan (https://keybase.io/jondcallahan) on keybase.
  • I have a public key whose fingerprint is F11A 091E EBE0 4691 DC82 E946 AD7F 8DAA F5BB CE85

To claim this, I am signing this object:

@jondcallahan
jondcallahan / SystemFonts.css
Created July 20, 2016 05:32
A font stack of default system fonts
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
@jondcallahan
jondcallahan / vue-hn.now styles
Created August 18, 2017 22:37
Stylebot styles for vue hn clone
body {
background-color: papayawhip;
color: rgba(39, 39, 39, 0.9);
font-family: Charter;
font-size: 18px;
line-height: 1.6;
}
.news-item {
background-color: rgba(255, 239, 213, 0.3);
@jondcallahan
jondcallahan / github.xml
Created November 27, 2017 21:37
Github OpenSearch for use in Firefox
<OpenSearchDescription
xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/"
>
<ShortName>Github</ShortName>
<Description>Search github</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">
https://github.com/favicon.ico
</Image>
@jondcallahan
jondcallahan / Backup Bear notes.scpt
Created May 21, 2019 16:57
AppleScript that will export your Bear.app notes. Note: Bear must be running
tell application "System Events" to tell process "Bear"
set frontmost to true
click menu item "Backup Notes..." of menu 1 of menu bar item "File" of menu bar 1
delay 1
key code 36 # Press enter
end tell
@jondcallahan
jondcallahan / optional-chaining-to-duck-typing.js
Created September 21, 2020 21:52
Turns JavaScript using optional chaining back to duck typed `&&` syntax
function optToDuck(string) {
const parts = string.split("?.");
let duck = "";
for (let i = 1; i <= parts.length;i++) {
for (let j = 0; j < i; j++) {
duck += `${parts[j]}`
if (j !== i -1) {
duck += '.'
}
}
@jondcallahan
jondcallahan / index.html
Created October 16, 2020 18:26
React + JSX in HTML file
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hello World</title>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
</head>
<body>
#!/usr/bin/env deno run --allow-net=openweathermap.org
// Parameters
// Required parameters:
// @raycast.schemaVersion 1
// @raycast.title Weather
// @raycast.mode inline
// @raycast.refreshTime 5m
#!/usr/bin/env deno run --allow-net
// Parameters
// Required parameters:
// @raycast.schemaVersion 1
// @raycast.title Stocks
// @raycast.mode inline
// @raycast.refreshTime 15m