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
title: Order | |
# fuck description | |
fields: | |
- name: name | |
- name: second | |
- name: body |
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
<!-- Система форм --> | |
{%- macro render_form(form, action=None, name="default") -%} | |
{# XXX: Place for global form error. | |
{% if form.errors %}...{% endif %} | |
#} | |
{% for name, field in form.form(name) %} | |
{{ row(field, name, **kwargs) }} | |
{% endfor %} | |
<input type="hidden" value="1" name="form.submitted"> |
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
find templates/ -name '*.html'|xargs -n 1 gawk ' | |
BEGIN {ln=0;} | |
{ln+=1} | |
ln==1 { | |
gsub("templates/?","",FILENAME); | |
label=FILENAME; | |
gsub("[/.]", "_", FILENAME); | |
cluster=label; | |
sub("/[^/]*$", "", cluster); |
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
[user] | |
name = xen | |
email = ***@xen.ru #masked | |
[color] | |
ui = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] |
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 cjson import decode, encode | |
with open('index.json') as f: | |
data = f.read() | |
jsnd = decode(data) | |
encode(jsnd) |
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 superserver.backend.megacode import evilDataTagList, evilDataTagAdd, evilDataTagDelete, evilDataTagUpdate, evilDataTagItemList, evilDataTagItemAdd, evilDataTagItemSet, evilDataTagItemDelete | |
# так писать правильно | |
from superserver.backend.megacode import (evilDataTagList, evilDataTagAdd, | |
evilDataTagDelete, evilDataTagUpdate, evilDataTagItemList, | |
evilDataTagItemAdd, evilDataTagItemSet, evilDataTagItemDelete) |
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
CREATE OR REPLACE FUNCTION unique_key_create() | |
RETURNS text AS | |
$BODY$ | |
DECLARE | |
_length INTEGER := 10; --from backend settings | |
_key TEXT; | |
BEGIN | |
WHILE TRUE LOOP | |
SELECT array_to_string( | |
ARRAY (SELECT substring('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' |
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
local w,h = display.contentWidth, display.contentHeight | |
local rec_width = 200 | |
local rec_height = 100 | |
local btnText = "Press me" | |
local rect1 = display.newRect((w-rec_width)/2, (h-rec_height)/2, rec_width, rec_height ) | |
local text = display.newText(btnText, w/2, h/2, native.systemFont, 30) | |
text:setTextColor(100, 100, 100) |
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 string | |
>>> | |
>>> leet = string.maketrans('abegiloprstz', '463611092572') | |
>>> | |
>>> s = 'The quick brown fox jumped over the lazy dog.' | |
>>> | |
>>> print s | |
The quick brown fox jumped over the lazy dog. | |
>>> print s.translate(leet) | |
Th3 qu1ck 620wn f0x jum93d 0v32 7h3 142y d06. |
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 flask import Flask, render_template | |
from flask.ext import gear | |
from flask.ext.pymongo import PyMongo | |
from formgear.models import Model, ModelRegistry | |
from formgear.utils import rel | |
from formgear.ds.mongo import MongoDS | |
class Post(Model): |