Skip to content

Instantly share code, notes, and snippets.

View PabloLefort's full-sized avatar
🌑

Lefort PabloLefort

🌑
View GitHub Profile

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 February 2, 2017 20:59
Mithril change data in other components
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 September 27, 2016 18:57
Wagtail template filter to resolve html
"""
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
@PabloLefort
PabloLefort / django-csv-export-utf8.py
Last active April 1, 2016 17:51
Django utf-8 csv export
'''
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.
"""