Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:

Lefort PabloLefort

:octocat:
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am PabloLefort on github.
  • I am lefortpablo (https://keybase.io/lefortpablo) on keybase.
  • I have a public key whose fingerprint is F332 7131 426B F21B 73B2 D11E 2608 9BB7 D191 2AF6

To claim this, I am signing this object:

@PabloLefort
PabloLefort / example.js
Created Feb 2, 2017
Mithril change data in other components
View example.js
var a = {
controller : function(){
var ctrl = this;
ctrl.data = m.prop(true);
ctrl.getData = function(){
ctrl.data = m.prop(!ctrl.data());
}
},
view: function(ctrl){
return m('div', [
@PabloLefort
PabloLefort / wagtail-html-support.py
Created Sep 27, 2016
Wagtail template filter to resolve html
View wagtail-html-support.py
"""
When editing the content use the brackets:
[[ <iframe>..</iframe> ]]
And after, use it in templates like this:
{{ page.body|resolve_html|richtext }}
"""
# templatetags/mytags.py
from django import template
View django-csv-export-utf8.py
'''
Using the same example on Python 2.7 docs
'''
import csv, codecs, cStringIO
class UnicodeWriter:
"""
A CSV writer which will write rows to CSV file "f",
which is encoded in the given encoding.
"""