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 assert(generate_expression( | |
'{"a": {"col": "abc"}}'), | |
'a = abc'); | |
SELECT assert(generate_expression( | |
'{"a": {"not": 2}}'), | |
'a <> 2'); | |
SELECT assert(generate_expression( | |
'{"a": {"not": [{"gt": 2}, {"lt": 2}]}}'), | |
'NOT (a > 2 AND a < 2)'); |
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
UPDATE accounts d | |
SET user_ids = user_ids_aggregated_value, | |
user_count = user_count_aggregated_value, | |
reported_user_count = reported_user_count_aggregated_value, | |
client_count = client_count_aggregated_value, | |
member_count = member_count_aggregated_value, | |
lead_member_count = lead_member_count_aggregated_value, | |
consultation_count = consultation_count_aggregated_value, | |
reported_consultation_count = reported_consultation_count_aggregated_value, | |
active_project_count = active_project_count_aggregated_value, |
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 email = '[email protected]' | |
var xhr = new XMLHttpRequest | |
xhr.onreadystatechange = function() { | |
if (xhr.readyState == 4) { | |
try { | |
var response = JSON.parse(xhr.response); | |
} catch (e) { | |
var response = { | |
status: xhr.status, | |
title: xhr.response |
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
Yaroslaff Fedin's CV | |
==================== | |
http://github.com/Inviz | |
Summary | |
---------------------- | |
An application developer, web developer, and front end developer with problem solving skills, attention to detail, adaptability, and the capacity to deliver cutting-edge solutions under strict deadlines. | |
Strengths |
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 IncomingOrder = { | |
// NO, if channel_notification option is set `nothing` | |
'preference.channel_notification == "nothing"': function() { | |
this.set('result', false, 100) | |
}, | |
// NO, if user is in dnd and message is not overriding it | |
'user_dnd && !message_dnd_override': function() { | |
this.set('result', false, 90) | |
}, | |
// NO, if it's a muted @here message |
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
// Loosely-formed runtime implementation of following action scheme: | |
// http://www.site.uottawa.ca/~bochmann/ELG7187C/CourseNotes/BehaviorModeling/Petri-nets/Orders%20-%20activity%20diagram.jpg | |
// async properties, which need some kind of outside world interaction to fill up | |
// - order.accepted - decided by admin | |
// - order.invoice - an object that holds details of payment request | |
// - order.payment - details of fulfilled payment | |
// - order.shipment - details of fulfilled shipment | |
// variables that can be mutated freely in runtime |
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
Petri = function() { | |
this.output = this.name; | |
} | |
Petri.compile = function(functions, name) { | |
var struct = {} | |
var size = 0; | |
var allArgs = functions.map(function(fn) { | |
return fn.toString().match(/\(\s*(.*?)\s*\)/)[0].split(/\s*,\s*/).map(function(arg, index) { | |
if (struct[arg] == null) |
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
describe('jot customizations', function() { | |
it ('splice partially remove beginning of LTR MOVE range',function() { | |
// short example | |
expect( | |
new jot.SPLICE(0, 1, "").compose( | |
new jot.SPLICE(1, 1, "") | |
).apply( | |
new jot.MOVE(1, 2, 4) | |
.apply('ABCDEFG') | |
) |
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
This postgres script provides an example for a system with | |
soft resolution of state change conflicts. | |
In this system updates do not mutate rows in tables, | |
instead they insert new rows retaining versioning metadata. | |
It is possible to restore all actions and side effects post-mortem. | |
A client first fetches current state of data, and receives its version id. | |
Client does somemething that invokes operations on that data, and changes it. | |
It then sends that data to server, with log of operation that led to it. |
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
eval $meta { | |
set_unescape_uri $flash $arg_flash; | |
postgres_pass database; | |
postgres_output json; | |
postgres_query " | |
SELECT 'abzc' as biggles, | |
singularize('$resource') as singular, | |
(SELECT columns from structures where table_name='$resource') as columns, | |
nullif('$flash', '') as flash"; | |
postgres_rewrite GET no_rows 403; |
NewerOlder