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
var cluster = require('cluster'), | |
net = require('net'); | |
if (cluster.isMaster) { | |
console.log('Master started'); | |
cluster.fork(); | |
// Wait 10sec and disconnect worker | |
setTimeout(function(){ |
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
#!/bin/bash | |
# TODO Add GruvBox | |
# TODO Add oh-my-git | |
mkdir -p ~/work/no_backup | |
# /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew install node | |
brew install python | |
brew install postgres |
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()); // ?? |
NewerOlder