Skip to content

Instantly share code, notes, and snippets.


Michael J. Radwin mjradwin

View GitHub Profile
View cloud-config.yaml
package_upgrade: true
- strongswan
- strongswan-plugin-eap-mschapv2
- moreutils
- iptables-persistent
- unattended-upgrades
OUTFILE=`mktemp /tmp/`
# uses heirloom-mailx on Ubuntu which supports -a for attachments
/opt/calibre/ebook-convert \
"$RECIPE.recipe" $OUTFILE --output-profile kindle && \
mjradwin / index.html
Last active Aug 27, 2021
Hebcal Shabbat API with AJAX
View index.html
<!DOCTYPE html>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<div id="results"></div>
document.addEventListener('DOMContentLoaded', function() {
View hebcal-swagger.yml
# Example YAML to get you started quickly.
# Be aware that YAML has indentation based scoping.
# Code completion support is available so start typing for available options.
swagger: '2.0'
# This is your document metadata
version: "1.0.0"
title: Hebcal API
description: Jewish Calendar, Hebrew Date Converter, Holidays
mjradwin / hebcal-shabbat-style.css
Last active Oct 25, 2015
Hebcal example of how to style Shabbat Times
View hebcal-shabbat-style.css
.hebcal-container {
font-family: "Gill Sans MT","Gill Sans",GillSans,Arial,Helvetica,sans-serif;
font-size: small;
.hebcal-container h3 {
font-family: Georgia,Palatino,"Times New Roman",Times,serif;
ul.hebcal-results { list-style-type:none }
ul.hebcal-results li {
margin-bottom: 11px;
mjradwin / winsorize-apache-spark.scala
Last active Aug 29, 2015
Winsorize an RDD of Doubles for Apache Spark
View winsorize-apache-spark.scala
import org.apache.spark.rdd.RDD
def winsorize(data: RDD[Double], limits:(Double,Double)): RDD[Double] = {
val r = data.sortBy(x => x)
val c = r.count()
if (c <= 2) r
else {
val n0 = limits._1 * (c + 1d)
val n1 = limits._2 * (c + 1d)
val k0 = n0.toLong
mjradwin / hebcal-shabbat-api.json
Last active Jul 24, 2020
Hebcal Shabbat REST API
View hebcal-shabbat-api.json
"title":"São Paulo, Brazil",
"city":"São Paulo",
"title":"São Paulo, Brazil",
mjradwin / form.html
Last active Nov 25, 2020
Hebcal Customizing Yahrzeit, Birthday and Anniversary Calendar for your website
View form.html
<form method="post" action="">
<input type="hidden" name="ref_url" value="">
<input type="hidden" name="ref_text" value="Temple Beth Am">
<select name="t1" class="form-control">
<option selected value="Yahrzeit">Yahrzeit</option>
<option value="Birthday">Birthday</option>
<option value="Anniversary">Anniversary</option>
<div class="form-group">
<label for="m1">Month</label>
mjradwin / hebcal-legacy-1-head.html
Created Feb 18, 2015
Hebcal legacy JS event calendar (deprecated)
View hebcal-legacy-1-head.html
<script type="text/javascript" charset="utf-8"
<script type="text/javascript"
<link type="text/css" rel="stylesheet"
<style type="text/css">
#myCalendarContainer table { width: 800px }
mjradwin / hebcal-converter-api.json
Created Feb 18, 2015
Hebcal Hebrew Date Converter REST API
View hebcal-converter-api.json
"gy": 2011,
"gm": 6,
"gd": 2,
"hy": 5771,
"hm": "Iyyar",
"hd": 29,
"hebrew": "כ״ט בְּאִיָיר תשע״א",
"events": [
"Parashat Nasso",