Skip to content

Instantly share code, notes, and snippets.

@alej0varas
alej0varas / liquidfeedback-2.0-install.sh
Created July 8, 2012 19:32
LiquidFeedback 2.0 installation script
################
# Installation #
################
WWW_USER="" # use the same name as your webserver user "www-data" "lighttpd", the one who connects to the database
WWW_PATH="" # must be accesible by your webserver "/var/www/liquidfeedback
POSTGRES_USERNAME="" # use the same name as your webserver user "www-data" "lighttpd"
INSTALL_PATH="/opt"
TMP_PATH="/tmp"
@alej0varas
alej0varas / translations.es.lua
Created July 8, 2012 19:37
LiquidFeedback 2.0 Spanish translation
#!/usr/bin/env lua
return {
["#{count} cancelled"] = false;
["#{count} days ago"] = false;
["#{count} finished"] = false;
["#{count} in discussion"] = false;
["#{count} in verification"] = false;
["#{count} in voting"] = false;
["#{count} more areas in this unit"] = false;
["#{count} new"] = false;
@alej0varas
alej0varas / forms.py
Last active April 13, 2016 11:16
Django Tastypie Base64MultiField for file upload using "application/json" Conten-Type You need a test.png file to test
import base64
from django import forms
from django.core.files.uploadedfile import SimpleUploadedFile
class Base64MultiField(forms.MultiValueField):
def __init__(self, *args, **kwargs):
kwargs['fields'] = (
forms.CharField(),
@alej0varas
alej0varas / hallofontsize.js
Created August 20, 2014 12:24
hallo.js font size plugin
// Hallo font size plugin
// Shows 7 buttons with an A + the size number.
// https://developer.mozilla.org/en-US/docs/Web/API/document.execCommand
// fontSize
// Changes the font size for the selection or at the insertion point. This requires an HTML font size (1-7) to be passed in as a // value argument.
//
// (c) 2014 Alejandro Varas
// hallofontsize may be freely distributed under the MIT license
(function(jQuery) {
@alej0varas
alej0varas / hallocolorpicker.js
Created August 20, 2014 14:23
hallo.js color picker plugin
// hallo colorpicker plugin
// (c) 2014 Alejandro Varas
// Based on https://github.com/25th-floor/hallo-simplecolorpicker-plugin
// hallocolorpicker may be freely distributed under the MIT license
(function(jQuery) {
return jQuery.widget("IKS.hallocolorpicker", {
colorElement : null,
options: {
uuid: '',
@alej0varas
alej0varas / hallofontfamily.js
Last active November 28, 2016 08:26
hallo.js font family plugin
// hallo fontfamily plugin
// (c) 2014 Alejandro Varas
// hallofontfamily may be freely distributed under the MIT license
(function(jQuery) {
return jQuery.widget("IKS.hallofontfamily", {
options: {
uuid: '',
fonts: [
// from http://web.mit.edu/jmorzins/www/fonts.html
@alej0varas
alej0varas / hallofontcolor.js
Last active August 29, 2015 14:05
hallo.js font color plugin
// hallo font color plugin
// (c) 2014 Alejandro Varas
// hallofontcolor may be freely distributed under the MIT license
(function(jQuery) {
return jQuery.widget("IKS.hallofontcolor", {
options: {
uuid: '',
colors: {
"#7bd148": "Green",
@alej0varas
alej0varas / trello.py
Created September 3, 2014 00:53
My Solution to Trello challenge
""" Trello job challeng """
from itertools import product
import sys
import unittest
letters = "acdegilmnoprstuw"
def pyhash(s):
"""
@alej0varas
alej0varas / colorpickerpanel.py
Created September 12, 2014 16:03
Wagtail CMS color picker panel. Requires jQuery plugin http://www.eyecon.ro/colorpicker/
from django.conf import settings
from django.utils.safestring import mark_safe
from wagtail.wagtailadmin.edit_handlers import BaseFieldPanel
class BaseColorFieldPanel(BaseFieldPanel):
def render_js(self):
big_javascript_block = """
(function() {
@alej0varas
alej0varas / wagtailredirectpage.py
Created September 26, 2014 12:41
Wagtail redirect page. Can link to page, ulr and document.
# Thanks to Ethan Jucovy
# http://www.coactivate.org/projects/ejucovy/blog/2014/05/10/wagtail-notes-managing-redirects-as-pages/
# This model comes from wagtaildemo
class LinkFields(models.Model):
link_external = models.URLField("External link", blank=True)
link_page = models.ForeignKey(
'wagtailcore.Page',
null=True,