Skip to content

Instantly share code, notes, and snippets.

@brantje
brantje / 8ball.py
Created September 6, 2013 11:44
Magic 8Ball for willie
"""
forum.py - Show a link to the xbian forum
Copyright 2013, Edward Powell - embolalia.net
Licensed under the Eiffel Forum License 2.
http://willie.dfbta.net
"""
import willie
import random
@willie.module.commands('8')
####################
# GZIP COMPRESSION #
####################
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/x-httpd-php
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
<?php
/**
* ownCloud - passman
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Sander Brand <brantje@gmail.com>
* @copyright Sander Brand 2014
*/
@brantje
brantje / gist:359dcaf5f177789db51d
Created July 24, 2014 13:18
Saving dialog positions
function make_draggable(elements) {
/* Elements is a jquery object: */
elements.draggable({
/* containment: 'parent',*/
start: function (evt, ui) {
ui.helper.css('z-index', ++zIndex);
var zoom = $('#notes').css('zoom');
pointerY = (evt.pageY - $('#notes').offset().top) / zoom - parseInt($(evt.target).css('top'));
poiTypes = {
shop = ['supermarket','bakery','car','stationery','hairdresser','mobile_phone','convenience','newsagent','kiosk','computer','clothes','variety_store','hearing_aids','florist','handicraft','candle','antique','pet','massage','electronics','laundry','doityourself','sports','jewelry','musical_instrument','chemist','shoes','beverages','toys','fishing','copyshop','beauty','bag','paint','bicycle','communication','furniture','alcohol','deli','optician','books','car_repair','butcher','outdoor','motorcycle','estate_agent','photo','gift','travel_agency','tea','wine','medical_supply','department_store','dry_cleaning','video','second_hand','greengrocer','erotic','curtain','haberdashery','garden_centre','art','fashion','bags','accessoires','confectionery','ice_cream','organic','music','boutique','interior','kitchen','vacant','tattoo','mall','camera','gallery','rc_models','coffee','bicycle_rental','photographer','ticket','charity','Shisha','hats','funeral_directors','locksmith','fabric','hardware','shoe_r
@brantje
brantje / update-owncloud.sh
Last active August 29, 2015 14:19
Owncloud update & update apps
#!/bin/bash
BRANCH="stable8"
ROOTDIR="$PWD"
WWWUSER="www-data"
WWWGROUP="www-data"
if [ $(id -u) != 0 ]; then
printf "**************************************\n"
printf "* Error: You must run this with sudo. *\n"
printf "**************************************\n"
exit 0
@brantje
brantje / bbscraper.php
Created January 17, 2016 15:01
postTopicReply function returns The submitted form was invalid. Try submitting again.
<?php
// base class with member properties and methods
class BBScraper
{
var $baseUrl;
private $user;
private $sid;
public $fetchedTopics = array();
public $topicReplys = array();
"websocket": {
"start_embedded_server": true,
"server_url": "0.0.0.0:4000",
"remote_control": true
}
@brantje
brantje / make-build.py
Created January 6, 2017 20:34
This is the release script i use for my passman builds
#!/usr/bin/env python
import os
import subprocess
from xml.dom import minidom
from pprint import pprint
import git
import urllib, json
import re
import wget
import zipfile
var api_request = function (endpoint, method, data, callback) {
API.cookies.getAll({url: _API.host}).then(function (cookies) {
if(!cookies){
make_request();
return;
}
if(cookies.length === 0){
make_request();
return;
}