Skip to content

Instantly share code, notes, and snippets.

View 1xch's full-sized avatar
⛈️
head in the clouds

1xch

⛈️
head in the clouds
  • laughs-in-flowers
View GitHub Profile
@1xch
1xch / gist:5166807
Last active December 14, 2015 23:39
Manage jinja2 macros with code
from flask import get_template_attribute
from jinja2 import Template
class MacroFor(object):
""" Use this as a mixin
e.g.
class ListItemBasic(MacroFor):
def __init__(self, listitem):
self.title = listitem.title
```
class Ticket
include DataMapper::Resource
if Rails::DataMapper.configuration.repositories["development" || "test" || "production"]["ticketengine"]
def self.default_repository_name
:ticketengine
end
end
@1xch
1xch / ???????????????
Created July 25, 2011 13:02
rvm issue
Ubuntu 11.04
zsh
--shell loads
/home/qx/.rvm/scripts/initialize:43: bad pattern: (/home/qx/.bash_profile
/home/qx/.rvm/scripts/initialize:43: bad pattern: (/home/qx/.bash_profile
% ➜ ~ rvm -v | 8:53:11 |
/home/qx/.rvm/scripts/initialize:43: bad pattern: (/home/qx/.bash_profile
rvm 1.6.25 by Wayne E. Seguin ([email protected]) [https://rvm.beginrescueend.com/]