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
select.form-control + .chosen-container.chosen-container-single .chosen-single { | |
display: block; | |
width: 100%; | |
height: 34px; | |
padding: 6px 12px; | |
font-size: 14px; | |
line-height: 1.428571429; | |
color: #555; | |
vertical-align: middle; | |
background-color: #fff; |
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 collections import namedtuple | |
from functools import wraps | |
from itertools import chain | |
from django.utils.functional import curry | |
from django.db.models import CharField | |
class StateField(CharField): | |
Starts = namedtuple('Starts', ['state']) |
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
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 | |
sudo echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/10gen.list | |
sudo sudo apt-get -y update | |
sudo apt-get -y install mongodb-10gen | |
# Start mongodb on startup | |
sudo update-rc.d mongodb defaults |
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
#include <QApplication> | |
#include <QLabel> | |
int main(int argc, char **argv) | |
{ | |
QApplication App(argc, argv); | |
QLabel Lbl("Hello KhoshGel!"); | |
Lbl.show(); | |
App.exec(); | |
} |
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
var maxfiles = {{ maxfiles }}; // {{ maxfiles }} returns from views.py | |
$(function() { | |
$("#uploader").pluploadQueue({ | |
runtimes : 'gears', // Initialize gears runtime | |
url : '{{ obj.get_image_upload_url }}', // Url to current object image uploading url | |
max_file_size : '4mb', | |
chunk_size: '4mb', | |
multiple_queues : true, | |
multi_selection: false, // It's necessary for file uploading limit | |
rename: true, |
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
const std::vector<std::string> toStdVector(const QVector<QString> &q_vect) | |
{ | |
std::vector<string> std_vect; | |
for (int i = 0; i < q_vect.size(); ++i) { | |
std_vect.push_back(q_vect[i].toStdString()); | |
} | |
return std_vect; | |
} |
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
const std::map<std::string, std::string> fromQMap(const QMap<QString, QString> &q_map) | |
{ | |
std::map<std::string, std::string> std_map; | |
QMap<QString, QString>::const_iterator i = q_map.constBegin(); | |
while (i != q_map.constEnd()) { | |
std_map.insert(std::pair<std::string, std::string>(i.key().toStdString(), i.value().toStdString())); | |
} | |
return std_map; | |
} |
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
const std::vector<std::string> fromQVector(const QVector<QString> &qVect) | |
{ | |
std::vector<std::string> stdVect; | |
for (int i = 0; i < qVect.size(); ++i) { | |
stdVect.push_back(qVect[i].toStdString()); | |
} | |
return stdVect; | |
} | |
const std::map<std::string, std::string> Aria2c::fromQMap(const QMap<QString, QString> &qMap) |
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
def forwards(self, orm): | |
""" | |
Slugify all the country.printable_name and put them in slug field | |
""" | |
from django.template.defaultfilters import slugify | |
for country in orm.Country.objects.all(): | |
country.slug = slugify(country.printable_name) | |
countey.save() | |
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
def queryset(self, request): | |
if request.user.is_superuser: | |
return self.model.objects.all() | |
return self.model.objects.filter(user=request.user) |
NewerOlder