Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View philippeowagner's full-sized avatar

Philippe O. Wagner philippeowagner

View GitHub Profile
(function($){
ListFilterCollapsePrototype = {
bindToggle: function(){
var that = this;
this.$filterTitle.click(function(){
that.$filterContent.slideToggle();
that.$list.toggleClass('filtered');
});
},
init: function(filterEl) {
#!/usr/bin/env python
#
# When triggered via a HTTP request, execute a command.
#
# Written by Senko Rasic <senko.rasic@goodcode.io>
# Released into Public Domain. Use it as you like.
#
# Usage: python trigger.py <host> <port> <key> <command>...
#
# HTTP GET and POST requests are supported. If you need more verbs or need
# Written by Senko Rasic <senko.rasic@goodcode.io>
# Released into Public Domain. Use it as you like.
from django.db import models
class SingletonModel(models.Model):
"""Singleton Django Model
Ensures there's always only one entry in the database, and can fix the
#!/usr/bin/env python
"""
Parse phone and email records out of vCard file and store them in a CSV.
Copyright (C) 2012 Senko Rasic <senko.rasic@dobarkod.hr>
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
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
try:
import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
@philippeowagner
philippeowagner / install-plugins.sh
Created May 19, 2014 20:55
Install cordova plugins - again and again.
#!/bin/sh
#cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file.git
#cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer.git
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information.git
#cordova plugin add org.apache.cordova.dialogs
cordova plugin add org.apache.cordova.inappbrowser
cordova plugin add org.apache.cordova.splashscreen
cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git
cordova plugin add https://github.com/Pushwoosh/pushwoosh-phonegap-3.0-plugin.git
@philippeowagner
philippeowagner / gist:a92b5733ebdee6b3895a
Created July 23, 2014 13:06
List outdated Python packages.
cd {{ proj_root }}
. ./bin/activate
pip list --outdated
@philippeowagner
philippeowagner / gist:629cb5cbc746ae7be54c
Created July 24, 2014 12:15
Use a ForeignKey to a django CMS page in your models. See also https://django-cms.readthedocs.org/en/2.4.3/extending_cms/fields.html for more info.
from django.db import models
from cms.models.fields import PageField
class MyModel(models.Model):
my_page = PageField()
MONATE = ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember']
WOCHENTAGE = ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag']