Skip to content

Instantly share code, notes, and snippets.

View danielbraun's full-sized avatar

Daniel Braun danielbraun

  • Tel-Aviv, Israel
View GitHub Profile
@bmcbride
bmcbride / LeafletToWKT.js
Last active June 7, 2022 02:17
Leaflet layer to WKT
function toWKT(layer) {
var lng, lat, coords = [];
if (layer instanceof L.Polygon || layer instanceof L.Polyline) {
var latlngs = layer.getLatLngs();
for (var i = 0; i < latlngs.length; i++) {
latlngs[i]
coords.push(latlngs[i].lng + " " + latlngs[i].lat);
if (i === 0) {
lng = latlngs[i].lng;
lat = latlngs[i].lat;
@bzerangue
bzerangue / iCal.xsl
Created November 3, 2011 04:54
[XSLT] iCal utility
<?xml version="1.0" encoding="utf-8"?>
<!--
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
X-WR-TIMEZONE;VALUE=TEXT:US/Central
METHOD:PUBLISH
PRODID:-//Park Cities Presbyterian Church\(PCA\)//iCal 1.0//EN
X-WR-CALNAME;VALUE=TEXT:Park Cities Presbyterian Church Events Feed
VERSION:2.0
BEGIN:VEVENT
@adeel
adeel / push-notifications.clj
Created July 26, 2011 01:03
Example of sending Apple push notifications with Clojure.
; Depends on [com.notnoop.apns/apns "0.1.6"].
(:import ('com.notnoop.apns APNS))
(defn send-push-notification [device-token message]
(let [service (.build (.withSandboxDestination
(.withCert (APNS/newService) "resources/apns-dev-cert.p12" "password")))
payload (.build (.alertBody (APNS/newPayload) message))]
(.push service device-token payload)))