Skip to content

Instantly share code, notes, and snippets.

@malakka
malakka / incidence.js
Last active May 26, 2022 18:03 — forked from kevinkub/incidence.js
COVID-19 Inzidenz-Widget für iOS innerhalb Deutschlands 🇩🇪
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
const newCasesApiUrl = `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_COVID19/FeatureServer/0/query?f=json&where=NeuerFall%20IN(1%2C%20-1)&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields=*&outStatistics=%5B%7B%22statisticType%22%3A%22sum%22%2C%22onStatisticField%22%3A%22AnzahlFall%22%2C%22outStatisticFieldName%22%3A%22value%22%7D%5D&resultType=standard&cacheHint=true`;
const incidenceUrl = (location) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&outFields=GEN,last_update,cases,cases7_per_100k&geometry=${location.longitude.toFixed(3)}%2C${location.latitude.toFixed(3)}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&returnGeometry=false&outSR=4326&f=json`
const saveIncidenceLatLon = (location) => {
let fm = FileManager.iCloud()
let path = fm.joinPath(fm.documentsDirectory(), "covid19latlon.json")
fm.writeStrin
set oldId to ""
repeat
set currentId to getTrackId()
if oldId is not currentId then
displayNotification()
end if
set oldId to currentId
write_to_file(getTrackName() & ":" & getTrackPosition(), (path to desktop as text) & getTrackArtistAlbumFilename(), false)
delay 1
end repeat
@bwaidelich
bwaidelich / CacheViewHelper.php
Created November 29, 2012 12:03
Cache View Helper for TYPO3 Fluid
<?php
namespace Your\Package\ViewHelpers;
/* *
* This script belongs to the TYPO3 Flow package "Your.Package". *
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License, either version 3 *
* of the License, or (at your option) any later version. *
* *
@amoilanen
amoilanen / webcrawler.js
Last active March 24, 2022 03:14
Simple PhantomJS-based web crawler library
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov anton.al.ivanov@gmail.com 2012
//UPDATE: This gist has been made into a Node.js module and now can be installed with "npm install js-crawler"
//the Node.js version does not use Phantom.JS, but the API available to the client is similar to the present gist
(function(host) {
function Crawler() {
this.visitedURLs = {};
};
@tolleiv
tolleiv / gist:3784342
Created September 25, 2012 20:48 — forked from entaroadun/gist:1653794
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

@reyjrar
reyjrar / logstash.conf
Created July 5, 2012 12:48
LogStash Configuration
input {
tcp {
type => "syslog"
port => 8514
}
}
filter {
## DISCARD IMPROPERLY FORMATTED MESSAGES
<?php
$mockHttpRequest = \TYPO3\FLOW3\Http\Request::create(new \TYPO3\FLOW3\Http\Uri('http://mock'));
$request = $mockHttpRequest->createActionRequest();
$response = new \TYPO3\FLOW3\Http\Response();
?>
@johnrees
johnrees / _ubuntu_steps.sh
Last active November 29, 2021 01:42
Standard Rails 5.* setup for Ubuntu 14.04 LTS
# As root user
sudo su
# Update the OS
sudo apt-get update -y
# Add this to ~/.bashrc to remove timezone warnings
echo 'export LC_ALL="en_US.UTF-8"' >> ~/.bashrc
source ~/.bashrc