Skip to content

Instantly share code, notes, and snippets.

View johannilsson's full-sized avatar

Johan Berg johannilsson

View GitHub Profile
# This is a bug fix for http://github.com/johannilsson/phplifestream/commit/bec96770f848f68a48a4e20339fe13ee5f556853 that is now reverted.
DELETE FROM tagged_streams WHERE stream_id IN (SELECT id FROM streams WHERE unique_id = SHA1( CONCAT( content_unique_id, service_id)));
DELETE FROM streams WHERE unique_id = SHA1( CONCAT( content_unique_id, service_id ) );
--- Zend/Tag/ItemList.php (revision 14515)
+++ Zend/Tag/ItemList.php (working copy)
@@ -83,7 +83,7 @@
}
// Calculate the thresholds
- $steps = count($weightList);
+ $steps = count($values);
$delta = ($maxWeight - $minWeight) / $steps;
$thresholds = array();
/*
* Copyright (C) 2009 Johan Nilsson <http://markupartist.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
#!/bin/bash
#
# whodunnit
# Parses the result of svn blame and displays a report of how many rows and
# percent each username has contributed with.
#
# created by johan.nilsson a bwin dot org and hans.nilsson a bwin dot org
#
if [ "$1" = "-h" ]
then
Time time = new Time();
time.setToNow();
Uri routesUri = Uri.parse(
String.format("journeyplanner://routes?start_point=%s&end_point=%s&time=%s",
"Telefonplan", "TCE", time.format2445()));
Intent routesIntent = new Intent(Intent.ACTION_VIEW, routesUri);
startActivity(routesIntent);
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Save it as a file named jms.sheet in .dia/sheets -->
<sheet xmlns="http://www.lysator.liu.se/~alla/dia/dia-sheet-ns">
<name>Jms</name>
<description>A collection of sample shapes.</description>
<contents>
<object name="Queue">
<description>The most minimal of shapes</description>
</object>
</contents>
package com.markupartist.sthlmtraveling.graphics;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.Paint.Style;
import android.graphics.drawable.Drawable;
import android.location.Location;
from django.utils.functional import curry
import Image
import os
class ThumbnailMixIn(object):
"""
Example mixin for creating and removing thumbnails on a model. Also adds some methods for accessing an url for an image size. It might be a better idea to use a custom image field instead of this approach.
Idea for getting the image url for different sizes from http://code.google.com/p/django-photologue
PS1='\[\e]0;\w\a\]\[\e[32m\]\u@\h:\[\e[33m\]\w\[\e[0m\]\$ '
// ==UserScript==
// @name RemoveClickableBackgroundOnVoddler
// @namespace voddler
// @include http://www.voddler.*/*
// ==/UserScript==
(function () {
var ad_background = document.getElementById("ad_background");
ad_background.setAttribute("id", "no_ad_background");
ad_background.style.cursor = "";
})();