Skip to content

Instantly share code, notes, and snippets.

View rootisenabled's full-sized avatar

Oleksandr Ivanov rootisenabled

View GitHub Profile
from cloud.mountingsurface.models import MountingSurface
from cloud.businessunits.models import BusinessUnit
bu_copy_from = BusinessUnit.objects.get(slug='otovo-nl')
bu_copy_to = BusinessUnit.objects.get(slug='otovo-be')
ms = MountingSurface.get_valid_choices_by_business_unit(bu_copy_from)
for m in ms:
m.pk = None
from cloud.inventory.models import BatteryModel, PanelModel, SmartMeterModel, EvChargerModel, InverterModel
from cloud.location.enums import Country
sm = SmartMeterModel.objects.filter(enabled_in_markets__contains=['de'])
bm = BatteryModel.objects.filter(enabled_in_markets__contains=['de'])
pm = PanelModel.objects.filter(enabled_in_markets__contains=['de'])
evm = EvChargerModel.objects.filter(enabled_in_markets__contains=['de'])
im = InverterModel.objects.filter(enabled_in_markets__contains=['de'])

Keybase proof

I hereby claim:

  • I am rootisenabled on github.
  • I am oleksiv (https://keybase.io/oleksiv) on keybase.
  • I have a public key ASBu9dXVmm1BueJ8CXXYmoNbYoLEF-bAGIFfXCHXTZ-ccQo

To claim this, I am signing this object:

@rootisenabled
rootisenabled / System Design.md
Created October 10, 2017 14:33 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@rootisenabled
rootisenabled / functional-utils.js
Created September 14, 2016 21:15 — forked from bendc/functional-utils.js
A set of pure and immutable ES2015 functions aimed to make functional JavaScript more idiomatic.
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)