- We call for the minified Vue.js library that’s hosted on our own server (for security reasons).
- Download the Development version: https://vuejs.org/js/vue.js and the production version: https://vuejs.org/js/vue.min.js
- Copy this files into the public/js folder
This file contains 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 logging | |
import time | |
from django.conf import settings | |
from django.db import connection | |
THRESHOLD = getattr(settings, 'SLOW_REQUEST_THRESHOLD', 1.0) | |
LOG_SQL = getattr(settings, 'SLOW_REQUEST_LOG_SQL', False) | |
LOG = logging.getLogger(__name__) |
This file contains 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
from datetime import datetime | |
from sqlalchemy import Column, Integer, DateTime, ForeignKey | |
from sqlalchemy.orm import relationship | |
from sqlalchemy.ext.declarative import declared_attr | |
from flask_security import current_user | |
class AuditMixin(object): | |
created_at = Column(DateTime, default=datetime.now) | |
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now) |
This file contains 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
#nav-bar ul { | |
list-style-type: none; | |
} | |
#nav-bar { | |
padding-left: 0; | |
} | |
#nav-bar > ul { | |
padding-left: 20px; |
This file contains 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
{# | |
Source: http://dev.dbl-a.com/symfony-2-0/symfony2-and-twig-pagination/ | |
Updated by: Simon Schick <[email protected]> | |
Parameters: | |
* currentFilters (array) : associative array that contains the current route-arguments | |
* currentPage (int) : the current page you are in | |
* paginationPath (string) : the route name to use for links | |
* showAlwaysFirstAndLast (bool) : Always show first and last link (just disabled) | |
* lastPage (int) : represents the total number of existing pages |
This file contains 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
<?php | |
use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder; | |
$encoder = new MessageDigestPasswordEncoder(); | |
echo $encoder->encodePassword('foo', ''); | |
// 5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg== |
This file contains 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
using System; | |
using System.IO; | |
using System.Messaging; | |
using System.Text; | |
using Newtonsoft.Json; | |
public class JsonMessageFormatter : IMessageFormatter | |
{ | |
private static readonly JsonSerializerSettings DefaultSerializerSettings = | |
new JsonSerializerSettings { |
This file contains 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
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
#uncomment next line if silex app root is in a mamp subdirectory | |
#RewriteBase /your_mamp_htdocs_silex_app_root | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^ web/index.php [L] | |
</IfModule> | |
define your silex routes as follows: | |
$app->get('/your_mamp_htdocs_silex_app_root/', function() { |
NewerOlder