GPIO.set_mode(2, GPIO.MODE_OUTPUT);
GPIO.blink(2, 1000, 1000)
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 makeFunc() { | |
var name = 'collectAI'; | |
function displayName() { | |
alert(name); | |
} | |
return displayName; | |
} | |
var myFunc = makeFunc(); | |
myFunc(); |
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 AWS = require('aws-sdk'); | |
const lambda = new AWS.Lambda({ region: 'eu-central-1', endpoint: 'http://localhost:3050' }); | |
const params = { | |
FunctionName: 'hello-world', | |
InvocationType: 'RequestResponse', | |
Payload: JSON.stringify({ | |
queryStringParameters: {}, | |
headers: {}, |
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 exec = require('child_process').execFile; | |
const path = require('path'); | |
const config = require('config'); | |
const url = config.get('datasource'); | |
const command = process.argv[2] || 'up'; | |
const basePath = path.join(process.cwd(), 'migrations') | |
const args = [`-url=${url}`, '-path=./sql', command]; | |
/* |
NewerOlder