Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
/* | |
This comes directly from John Resig's MicroTemplating, but with {%= %} instead of <%= %> for the dynamic sections. | |
http://ejohn.org/blog/javascript-micro-templating/ | |
This lets you use just natural Javascript, along with whatever JS library you're using, and can be inside of a Rails erb template, or whatever. | |
Used with a template inside the HTML of the page: | |
<script type="text/html" id="user_tmpl"> |
// Via @thomasfuchs (http://mir.aculo.us/2011/03/09/little-helpers-a-tweet-sized-javascript-templating-engine/) | |
function t(s, d){ | |
for(var p in d) | |
s = s.replace(new RegExp('{'+p+'}','g'), d[p]); | |
return s; | |
} |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
As configured in my dotfiles.
start new:
tmux
start new with session name:
# $ crx `pwd` | |
function crx() { | |
~/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --pack-extension=$@ --pack-extension-key=$@/key.pem | |
} |
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
--- | |
Name: app | |
After: framework/routes#coreroutes | |
--- | |
Director: | |
rules: | |
'dev': 'DevelopmentAdmin' | |
'sitemap.xml': 'GoogleSitemap' | |
'$Action' : 'BaseController' |
from collections import namedtuple | |
from pymongo import MongoClient | |
from flask import request | |
from core.web.site import app | |
from core.web.site.views_master import * | |
import json | |
''' | |
$('#companies').dataTable( { | |
"bProcessing": true, |
Sentry is an amazing auth system. But I really need a feature: multiple user types in the same app. And I cannot separate those in groups, because they have different table columns. After 2 days burning my head, I think I found a good solution. The magic is duplicate SentryServiceProvider with new different settings.
Lets suppose we have a fresh Sentry install with default User ambient. Now we want another ambient called Admin, with new model and different settings. How to do: