Skip to content

Instantly share code, notes, and snippets.

View tmodrzynski's full-sized avatar

Tomasz Modrzyński tmodrzynski

View GitHub Profile
@tmodrzynski
tmodrzynski / cms-views.sql
Last active September 29, 2016 13:38
CMS views made readable
CREATE OR REPLACE
ALGORITHM=MERGE SQL SECURITY DEFINER VIEW `cms_view_bets_preplay` AS
SELECT
coalesce(`b_each_way`.`id`, `b`.`id`) AS `id`,
`b`.`status` AS `status`,
`b`.`history_id` AS `transaction_id`,
`b_each_way`.`win_bet_id` AS `ew_win_bet_id`,
coalesce(`b_each_way`.`outcome`, `b`.`outcome`) AS `outcome`,
`b`.`is_each_way` AS `is_each_way`,
`b`.`bet_structure_id` AS `bet_structure_id`,
@tmodrzynski
tmodrzynski / 1.js
Created November 26, 2015 21:05
RMS 4727
var _ = require('underscore')
// function sayHello() {
// console.log('Hello, World');
// }
// _.times(5, sayHello);
function test(i) {
var arr = [];
@tmodrzynski
tmodrzynski / ndb-properties-migration.md
Last active April 5, 2017 06:27
ndb.Model - migrating properties like a boss

ndb.Model - migrating properties like a boss

The problem

Consider following model:

class X(ndb.Model):
    prop1 = ndb.StringProperty()
    prop2 = ndb.StringProperty()