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) |
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
# | |
# Definitions of ISO 4217 Currencies | |
# Source: http://www.iso.org/iso/support/faqs/faqs_widely_used_standards/widely_used_standards_other/currency_codes/currency_codes_list-1.htm | |
# | |
CURRENCY['BZD'] = Currency(code='BZD', numeric='084', name='Belize Dollar', countries=['BELIZE']) | |
CURRENCY['YER'] = Currency(code='YER', numeric='886', name='Yemeni Rial', countries=['YEMEN']) | |
CURRENCY['XBA'] = Currency(code='XBA', numeric='955', name='Bond Markets Units European Composite Unit (EURCO)', countries=[]) | |
CURRENCY['SLL'] = Currency(code='SLL', numeric='694', name='Leone', countries=['SIERRA LEONE']) | |
CURRENCY['ERN'] = Currency(code='ERN', numeric='232', name='Nakfa', countries=['ERITREA']) |
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
#!/usr/bin/env python | |
import sys | |
base_path = sys.argv.pop() | |
sys.path.insert(0, base_path) | |
from fix_getpass import fixGetpass | |
import os | |
from django.core.management import execute_manager | |
# Fucking hack to set local env for django debug | |
# yeah |
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
" -[ General behaviour ]- | |
" general | |
set nocompatible | |
set nowrap | |
syntax on | |
filetype plugin indent on | |
" search | |
set nohls | |
set incsearch |
OlderNewer