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
/* onBuildRead hooks before optimizations, which is what we need in order to | |
* fake Bootstrap having define() call | |
*/ | |
onBuildRead: function (name, path, contents) { | |
var jqueryVar = 'jqueryModule'; | |
var wrapperHead = "define('" + name + "', ['jquery'], "; | |
var wrapperTail = ");"; | |
if (name === "bootstrap") { | |
console.log("Wrapping bootstrap in " + wrapperHead + "..." + wrapperTail); |
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
# A simple generator wrapper, not sure if it's good for anything at all. | |
# With basic python threading | |
from threading import Thread | |
try: | |
from queue import Queue | |
except ImportError: | |
from Queue import Queue | |
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 function array_foreach(text, anyarray) returns anyarray as $$ | |
declare | |
funcname alias for $1; | |
vals alias for $2; | |
results alias for $0; | |
begin | |
execute format('select array_agg(s.t) from (select %I(unnest($1))) as s(t)', funcname) into results using vals; | |
return results; | |
end; | |
$$ language plpgsql; |
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 itertools | |
from sqlalchemy import util, and_, case | |
from sqlalchemy.ext.compiler import compiles | |
from sqlalchemy.sql import ColumnElement | |
from sqlalchemy.sql.elements import ClauseList, _clone | |
from sqlalchemy.sql.functions import FunctionElement | |
class AggregateFilter(ColumnElement): | |
"""Represent a FILTER clause. |
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
class JsonColumn(object): | |
""" | |
Descriptor class for accessing values from `JSONB` columns. | |
**In Expressions**: | |
As class attribute the descriptor resolves the class property | |
pointing to prepared `JSONB` element using the ``'column'`` value's | |
:attr:`key` attribute. It then uses the element's item accessor with the | |
``*keys`` and returns it :attr:`astext`, if not ``'astext'`` is 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
static const char m[] = { | |
24,24,18,19, | |
21,21,19,18, | |
16,16,16,19, | |
24,24,21,19, | |
18,18,18,19, | |
21,21,24,24, | |
19,19,16,16, | |
0,0,0,0, |
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
-module(mq). | |
-export([ | |
start/0, disp_status/1, get_status/1, add_task/2, add_simple_worker/2, | |
add_worker/2, send_ack/1, echo_worker/0 | |
]). | |
-spec start() -> pid(). | |
%% @doc Spawn new queue and return process id. | |
start() -> | |
spawn(fun loop/0). |
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 sqlalchemy.sql.selectable import HasPrefixes | |
from sqlalchemy.sql.base import Executable | |
from sqlalchemy.sql.elements import ClauseElement | |
from sqlalchemy.ext.compiler import compiles | |
from sqlalchemy import Table, MetaData | |
class SelectInto(HasPrefixes, Executable, ClauseElement): | |
def __init__(self, |
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 inspect | |
import argparse | |
def _helpfor(param): | |
if param.annotation is not inspect.Parameter.empty: | |
if isinstance(param.annotation, type): | |
return param.annotation.__name__ | |
return str(param.annotation) | |
return param.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 sqlalchemy.ext.compiler import compiles | |
from sqlalchemy.dialects import plugins | |
from sqlalchemy.dialects.mysql.json import JSONIndexType, JSONPathType | |
from sqlalchemy.engine import CreateEnginePlugin | |
from sqlalchemy.sql.elements import BinaryExpression | |
from sqlalchemy.sql import sqltypes | |
from sqlalchemy.sql.operators import \ | |
json_getitem_op, \ | |
json_path_getitem_op |
OlderNewer