(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
""" | |
Setup: | |
Assuming Odoo 8.0 sources at ~/odoo: | |
$ cp odoo-sh.py ~/odoo | |
$ cd ~/odoo | |
$ python -i odoo-sh.py | |
Usage example: | |
>>> env = connect('my-db-name') | |
>>> Users = env['res.users'] |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
-- | Simple in-process key/value cache | |
-- | |
-- Of course, for really simple stuff you could probably use unsafeInterleaveIO | |
module Cache (Cache, newCache, fromCache) where | |
import Control.Monad (void) | |
-- Could also use STM instead | |
import Control.Concurrent (forkIO, Chan, newChan, readChan, writeChan, MVar, newEmptyMVar, putMVar, takeMVar) |
"Requires at least the Spec version from Pharo 2.0" | |
| layout widget | | |
model := DynamicComposableModel new. | |
layout := SpecLayout composed. | |
layout newColumn: [ :col | | |
{1. 2. 3} do: [:e | | selector | | |
selector := ('accessorTo', e asString) asSymbol. | |
model instantiateModels: {selector. #TextInputFieldModel}. | |
widget := model perform: selector. |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |