Demonstrates how to load SVG's as Leaflet icons via the data URI method.
Following was helpful to figure this out:
Demonstrates how to load SVG's as Leaflet icons via the data URI method.
Following was helpful to figure this out:
<body><script> | |
/* SET `$appurl` as argument to the IIFE | |
to load any javascript (localstorage size limit 5mb) | |
The first page visit will load the whole script, follow-up visits | |
load the cached script right away and if a new version is available, | |
offer to update the app now or later. | |
(The caching only works if the server sends `header.etag`) | |
I welcome suggestions/questions/discussions - just drop me a message :-) | |
http://twitter.com/serapath |
The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.
I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.
#!/bin/sh | |
#Check the Drive Space Used by Cached Files | |
du -sh /var/cache/apt/archives | |
#Clean all the log file | |
#for logs in `find /var/log -type f`; do > $logs; done | |
logs=`find /var/log -type f` | |
for i in $logs |
/* An HTML template in 180 bytes (minified) | |
Features: Escapes HTML, accepts either strings or functions as values, and that's all (it doesn't handle looping). | |
Usage: | |
OneEightyT( | |
"<h1>{name}</h1><div>{content} @ {currentTime}</div>", | |
{ | |
name: "Stella", |
I have a simple Rails app that collects all the tweets I favorite on Twitter so I can sort and search through them at my leisure. Many of those favorites contain links I'd like to refer to, so I wrote a helper method that converts them to clickable anchor tags that looked like this:
# app/helpers/favorites_helper.rb
module FavoritesHelper
# snip
def text_to_true_link(tweet_text)
urls = tweet_text.scan(/https*:\/\/t.co\/\w+/)
import java.io.*; | |
DataInputStream dis; | |
void setup() | |
{ | |
size(256, 256); | |
try { | |
dis = new DataInputStream(new FileInputStream("/home/robbe/tmp/howtodrawmushrooms.8s.raw")); // 192khz, 8 bit signed, stereo PCM |
// Assuming you are inside an event (Mouseover, Click). | |
// Layer comes from the event. | |
// Get the bounds of the layer to display the popup on the north-east bounds. | |
var bounds = layer.getBounds(); | |
var latLng = bounds.getCenter(); |
#!/bin/sh | |
# | |
# The MIT License | |
# | |
# Copyright 2014-2017 Jakub Jirutka <[email protected]>. | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |