Consider this blog post model:
/** | |
* Module dependencies | |
*/ | |
var express = require('express'); | |
var fs = require('fs'); | |
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
// img path |
#models.py | |
class StoreType(models.Model): | |
name = models.CharField(max_length=24, unique=True) | |
class Meta: | |
ordering = ["name"] | |
def __unicode__(self): | |
return ("%24s" % (self.name)) | |
class Store(models.Model): | |
name = models.CharField(max_length=24) |
from django.core.exceptions import ImproperlyConfigured | |
from django.core.management import call_command | |
from django.db.models.signals import post_syncdb | |
from south.models import MigrationHistory | |
import pizzanuvola_teaser.settings as settings | |
def migration_exists(appname, migrationnumber): | |
appname = appname.split('.')[-1] | |
return MigrationHistory.objects.filter(app_name=appname, migration__icontains=migrationnumber).exists() |
Reposted from Qiita
For almost a year now, I've been using this "flux" architecture to organize my React applications and to work on other people's projects, and its popularity has grown quite a lot, to the point where it shows up on job listings for React and a lot of people get confused about what it is.
There are a billion explainations on the internet, so I'll skip explaining the parts. Instead, let's cut to the chase -- the main parts I hate about flux are the Dispatcher and the Store's own updating mechanism.
If you use a setup similar to the examples in facebook/flux, and you use flux.Dispatcher, you probably have this kind of flow:
Go to the egghead website, i.e. Building a React.js App
run
$.each($('h4 a'), function(index, video){
console.log(video.href);
});
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
This file is part of Whonix | |
Copyright (C) 2012 - 2014 Patrick Schleizer <adrelanos@riseup.net> | |
See the file COPYING for copying conditions. | |
**** Do NOT edit this file! **** | |
This file will show you examples you can copy and paste to /etc/tor/torrc | |
Additionally, you can read the official Tor Manual at: | |
https://www.torproject.org/docs/tor-manual.html.en |