Skip to content

Instantly share code, notes, and snippets.

💾

Gilles De Mey gillesdemey

💾
Block or report user

Report or block gillesdemey

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gillesdemey
gillesdemey / README.md
Last active Feb 11, 2019
Collector Compose
View README.md

Collector Compose

Prerequisites

⚠️ Make sure you have hoard-compose running ⚠️

This application will join the docker network created by hoard-compose, or manually create it using docker network create waylay.

Start application

View counter.jsx
import React, { Fragment, useState } from 'react'
import Button from '../button/button'
function Counter (props) {
const [count, setCount] = useState(props.initialCount)
function increment () {
setCount(count + 1)
}
View package.json
{
"name": "my-awesome-app",
"jest": {
"snapshotSerializers": [
"jest-snapshots-json-rest-api"
]
}
}
View snapshot.js
exports[`get a user 1`] = `{
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"created_at": {
"type": "string"
},
"email": {
"type": "string"
},
"first_name": {
@gillesdemey
gillesdemey / get-users.test.js
Last active Feb 20, 2018
snapshot-user.json.snap
View get-users.test.js
const app = require('./app')
const request = require('supertest')
test('get a user', async () => {
const response = await request(app)
.get('/users/1')
expect(response.status).toBe(200)
expect(response).toMatchSnapshot()
})
View hypotheek.js
'use strict'
const AMOUNT = 300000
const YEARS = 25
const RATE = 2.19
const MONTHS = yearsToMonths(YEARS)
const MONTHLY = monthly(AMOUNT, YEARS, RATE)
// generate an array with shorted name of each month
View sht21.js
// Module to talk to the SHT21 temperature and humidity sensor over I2C
var i2c = require('i2c');
// Register addresses
const TRIGGER_T_MEASUREMENT_NO_HOLD = 0xF3;
const TRIGGER_RH_MEASUREMENT_NO_HOLD = 0xF5;
const WRITE_USER_REGISTER = 0xE6;
const READ_USER_REGISTER = 0xE7;
const SOFT_RESET = 0xFE;
@gillesdemey
gillesdemey / .drone.yml
Created May 29, 2017
Authenticate with gloud and kubectl in Drone
View .drone.yml
pipeline:
...
deploy:
image: google/cloud-sdk
commands:
- printenv KUBE_SERVICE_ACCOUNT > credentials.json
- gcloud auth activate-service-account --key-file=credentials.json
- "gcloud container clusters get-credentials $CLUSTER_NAME \
--zone $PROJECT_ZONE \
--project $PROJECT_NAME"
View packages.yml
atom-alignment
atom-ternjs
docblockr
emmet
file-icons
highlight-selected
hyperclick
js-hyperclick
linter
linter-js-standard
View pingpong.go
package main
import (
"fmt"
"time"
)
func pinger(channel chan<- string) {
for {
channel <- "ping"
You can’t perform that action at this time.