This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2, json, random, sys | |
from flask import Flask, request, make_response | |
app = Flask(__name__) | |
TIMELINE_DATA = None | |
@app.route('/public_timeline.json') | |
def public_timeline(): | |
out = json.dumps(sorted(TIMELINE_DATA, key=lambda x: random.random())) | |
if 'callback' in request.args: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/twitter/bootstrap/issues/675#issuecomment-6184243 | |
$('#feedback-modal').modal({ | |
backdrop: true, | |
keyboard: true | |
}).css({ | |
'width': function () { | |
return ($(document).width() * .9) + 'px'; | |
}, | |
'margin-left': function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# makefile pour thème bootstrap personnalisé | |
# | |
# usage dans un makefile supérieur: | |
# $(MAKE) ${MAKEFLAGS} BUILD_DIR=${BUILD_DIR}/theme BOOTSTRAP_SOURCE=${BOOTSTRAP_SOURCE} | |
# ou dans ce makefile: | |
# BUILD_DIR=./build | |
# BOOTSTRAP_SOURCE=${HOME}/src/bootstrap | |
# | |
# bootstrap 2.1.0-wip utilise normalement `recess` | |
# `lessc` permet de surcharger localement des .less (option "--include-path") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'jquery', | |
'underscore', | |
'backbone', | |
'marionette', | |
'handlebars', | |
'text!templates/app_view.html', | |
'modules/mainMenuView/mainMenuView', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App = new Marionette.Application(); | |
App.addRegions { | |
"headerRegion": "#header" | |
"topMenuRegion": "#top-menu" | |
"mainRegion" : "#main" | |
} | |
App.on 'initialize:after', -> | |
Backbone.history.start() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* twig.async.js | |
* | |
* An asynchronous implementation of twigjs that returns a Promise on instantiation if the template is asynchronous. | |
* Works just like twig(), but when instantiated, twigAsync returns a Promise. The twig template | |
* is passed as the only parameter when resolving the Deferred object. | |
* | |
* e.g. | |
* tpl = twigAsync({href:'/templates/profile/profile-welcomeNewDesign.twig'}); | |
* $.when(tpl).done(function(twigTemplate){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'marionette', | |
'router', | |
'controller', | |
'modules/auth', | |
'modules/vent', | |
'views/_layout' | |
], function(Marionette, Router, Controller, Auth, Vent, Layout){ | |
var App = new Marionette.Application(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import logging | |
import os | |
from os.path import abspath, dirname, join | |
from os import environ | |
from fabric.api import env, task | |
from fabric.operations import local | |
from fabric.operations import sudo | |
from fabric.utils import puts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Simple Backbone WordPress Example</title> | |
<link rel="stylesheet" href="base.css"> | |
</head> | |
<body> | |
<ul id="post-list"></ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'backbone', | |
'application', | |
'apps/my-app-mod/layout/my-app-mod-layout', | |
'apps/my-app-mod/my-app-mod-list', | |
'apps/my-app-mod/item/message-view', | |
'apps/my-app-mod/my-app-mod' | |
], function(Backbone, app, MyAppModLayout, MyAppModListController, MessageView, AppRouter) { | |
'use strict'; |