GPIO.set_mode(2, GPIO.MODE_OUTPUT);
GPIO.blink(2, 1000, 1000)
I hereby claim:
- I am ataube on github.
- I am andreastaube (https://keybase.io/andreastaube) on keybase.
- I have a public key ASA_NKvCq7f-n8IwflxKjelaG-iHFrHwVvTJO_pRcKRi0Qo
To claim this, I am signing this object:
The following steps explain a workaround to connect from a container to a postgres server installed on the host system. This pattern can be applied to other (host) services as well.
- Install postgres
brew install postgres
brew services start postgres
(https://github.com/Homebrew/homebrew-services)
- Attach a unused IP to the local lo0 interface
sudo ifconfig lo0 alias 10.200.10.1/24
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 es = require('event-stream'); | |
const R = require('ramda'); | |
function getRandomInt(min, max) { | |
var min = Math.ceil(min); | |
var max = Math.floor(max); | |
return Math.floor(Math.random() * (max - min)) + min; | |
} | |
const readable = es.readArray(R.map(R.toString, R.range(1, 5000))); |
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
// authenticate | |
function authenticate() { | |
const url = [ | |
'http://localhost:8080/', | |
'auth/realms/collectai/protocol/openid-connect/auth', | |
'?response_type=code&client_id=portals-api&redirect_uri=http://localhost:3000/merchant', | |
]; | |
document.location.assign(url.join('')); | |
} |
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 compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...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
const fs = require('fs'); | |
const es = require('event-stream'); | |
const JSONStream = require('JSONStream'); | |
const inStream = fs.createReadStream('tests/fixtures/claims10k.json'); | |
const outStream = fs.createWriteStream('tests/fixtures/claims10kPatched.json'); | |
const map = es.mapSync((d) => { | |
const email = `${d.debtorName.toLowerCase()}.${d.debtorLastName.toLowerCase()}@email.com`; | |
return Object.assign({}, d, { email }); |
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 Transaction = require('loopback-datasource-juggler'); | |
const update = async (ids, delta) => { | |
const result = []; | |
const tx = await models.MyModel.beginTransaction({ isolationLevel: Transaction.READ_COMMITTED }); | |
try { | |
for (const id of ids) { | |
const entity = await updateById(id, delta, { transaction: tx }); | |
result.push(entity); | |
} |
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
yarn logs -applicationId ... | |
spark-submit --master yarn-cluster --driver-class-path /usr/share/java/mysql-connector-java.jar --jars /usr/share/java/mysql-connector-java.jar,/usr/hdp/2.3.4.0-3485/spark/lib/datanucleus-core-3.2.10.jar,/usr/hdp/2.3.4.0-3485/spark/lib/datanucleus-rdbms-3.2.9.jar,/usr/hdp/2.3.4.0-3485/spark/lib/datanucleus-api-jdo-3.2.6.jar --files /etc/spark/2.3.4.0-3485/0/hive-site.xml myapp.py | |
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
@Entity | |
public class EntityA { | |
private String name; | |
} | |
@Entity | |
public class EntityB { | |
@OneToOne | |
private EntityA entityA; |
NewerOlder