Skip to content

Instantly share code, notes, and snippets.

View colinfrei's full-sized avatar

Colin Frei colinfrei

  • Liip
  • Switzerland
View GitHub Profile
@colinfrei
colinfrei / aha-app-allergy-data.json
Created May 24, 2019 12:13
Swiss Allergy / Pollen information from aha.ch / Pollen-News app
/*
This is the slightly annotated data that the Pollen-News app uses to provide
allergy & pollen information for Switzerland.
Data fetched from http://app.tinyurl.aha.ch/?lang=de
Allergens:
poac: Gräser
plat: Platane
fagu: Buche
<html>
<body style="background-color:black; font-size: 72px; color: white; padding: 50px 100px; font-family:Arial; text-transform: uppercase;">
abcdefghijklmnopqrstuvwxyz
<div style="padding: 50px;" contenteditable="true" autocorrect="off" spellcheck="false">HALLO</div>
</body>
</html>
@colinfrei
colinfrei / process.py
Last active September 24, 2018 22:00 — forked from jamesstout/process.py
always use the local timezone
# -*- coding: utf-8 -*-
import alfred
import calendar
import time
import math
from delorean import now, parse, epoch
# global var to see if user
# has a time offset
@colinfrei
colinfrei / gist:8b775ccd09cc51c19b79
Last active March 23, 2017 08:33
Sending an SMS with Llama using an Android Intent
@colinfrei
colinfrei / index.html
Created June 14, 2014 13:55
SMS Notifier
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="stuff"></div>
<button id="button">fdoo</button>
<script type="text/javascript">
var xmlhttp;
<?php
use Symfony\Component\Finder\Finder;
/**
* HOW TO USE THIS:
* - Install the dependencies using composer install (see https://getcomposer.org/download/ if you don't have composer)
* - Download the bugzilla email addresses as a csv file and save it in the same folder as this file
* - Adjust the values of the three variables below
* - Run the script from the command line like this: php bugzilla-count.php
@colinfrei
colinfrei / deploy.rb
Created November 8, 2012 13:00
Capistrano recipe to add an htaccess file when deploying
# [...]
set :htaccess_username, "User"
set :htaccess_password, "Password"
#set :htaccess_password_hashed, "zJDC6IeGdG8QU"
before "deploy:create_symlink", "deploy:htaccess_protect"
# [...]
@colinfrei
colinfrei / ServiceAliasPass.php
Created November 7, 2012 07:44
Generic class to allow overwriting a service
<?php
namespace Symfony\Component\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Alias;
/**
* Overwrites a service with an alias to a new service, and injects the old service as a parent of the new one
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><description>Here is my very fabulous posts</description><pubDate>Sun, 19 Feb 2012 17:38:08 +0100</pubDate><lastBuildDate>Sun, 19 Feb 2012 17:38:08 +0100</lastBuildDate><link></link><title>My fabulous posts</title><language>de</language><item><title>New News Article</title><description>New News Article Content</description><guid>2</guid><link>http://sandoz.lo</link><pubDate>Sun, 19 Feb 2012 17:38:08 +0100</pubDate><category></category></item><item><title>dingaling</title><description>dingdong</description><guid>5</guid><link>http://sandoz.lo</link><pubDate>Sun, 19 Feb 2012 17:38:08 +0100</pubDate><category></category></item></channel></rss>
@colinfrei
colinfrei / gist:1710699
Created January 31, 2012 14:14
Mock object to simulate Phonegap iOS keychain plugin using cookies
function fakeKeychain() {
if (BROWSER === "Desktop") {
function createCookie(name, value, days) {
var expires;
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toGMTString();
}
else {