brew install stlink
brew install open-ocd
brew tap osx-cross/arm
brew install arm-gcc-bin
brew install --cask clion
- Install JDK (run
sudo java
and follow instructions) - Download STM32CubeMX (registration is required), unpack archive
- Run unstaller
sudo java -jar SetupSTM32CubeMX-6.1.1.exe
(version will be different!)
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 A extends Control { | |
protected _x: object = { | |
val: 1, | |
_version: 0 | |
} | |
_doSomthing() { | |
this._x._version++; | |
} |
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 DoStuff { | |
runAnimation() { | |
return new Promise((resolve, reject) => { | |
const run = true; | |
const step = () => { | |
if (run) { | |
run = this._doSomething(); |
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('Some case', () => { | |
before(() => { | |
// Mock BL here | |
declareMock('Object.Method').staticResponse(new RecordSet(....)); | |
declareMock('Object.Complicated').withResolver((args) => { | |
// if arg1 > 10 -> result1 | |
// if arg1 <= 10 -> result2 | |
}); | |
}); |
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
function apiWrapper(args) { | |
const method = getMethodSomehow(args); // Тут мы как-то получили someAppliedAPI | |
return method(args).catch((e) => { | |
// это общий обработчик | |
}) | |
} | |
function someAppliedAPI(args) { | |
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
console.log(0); | |
for(var i = 0; i < 1000000000; i++) { | |
setTimeout(function() { | |
console.log(1); | |
}, 0); | |
} | |
console.log(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
const o = { | |
foo: function() { return this.bar }, | |
bar: 10 | |
}; | |
const f = o.foo; | |
console.log(f()); // ?? |
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
const cls = require('cls-hooked'); | |
const ctx = cls.createNamespace('test-cls-context'); | |
// result of this demo: 4 and 13 | |
// despite ctx is "global", every async "context" has it's own strage and values are not mixed between timeouts | |
setTimeout(() => { | |
ctx.run(() => { | |
ctx.set('value', 1); | |
setTimeout(() => { |
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
// router.js | |
app.get('/', (req, res) => { | |
// generate rewuest uuid | |
// assign it to something (?) | |
// kick in some app logic | |
}); | |
// db.js | |
async function getAfromB() { | |
const result = await driver.oneOrNone('SELECT a FROM b'); |
NewerOlder