Skip to content

Instantly share code, notes, and snippets.

Markus Tacker coderbyheart

Block or report user

Report or block coderbyheart

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
View generate-sensor-messages.ts
import { Chance } from 'chance'
import { v4 } from 'uuid'
import { createWriteStream, WriteStream } from 'fs'
import * as path from 'path'
const numMessages = parseInt(process.argv[process.argv.length - 2], 10)
const outDir = process.argv[process.argv.length - 1]
const allSensors = [] as string[]
for (let i = 0; i < 5; i++) {
View gps.proto
package gps;
syntax = "proto3";
message gps {
message V {
double lng = 0;
double lat = 1;
double acc = 2;
double alt = 3;
double spd = 4;
@coderbyheart
coderbyheart / make-dummy-cert
Last active Apr 16, 2019
Elastic Beanstalk Nginx Configuration File
View make-dummy-cert
#!/bin/sh
umask 077
answers() {
echo --
echo SomeState
echo SomeCity
echo SomeOrganization
echo SomeOrganizationalUnit
echo localhost.localdomain
View SIMVendorRepository.ts
import { SIMVendor } from './SIMVendor';
export interface SIMVendorRepository {
findAll(): Promise<SIMVendor[]>;
/**
* @throws EntityNotFoundError if the SIMVendor cannot be found.
*/
getByUUID(uuid: string): Promise<SIMVendor>;
@coderbyheart
coderbyheart / How to provision a nRF9160 DK with custom cloud credentials.md
Created Jan 30, 2019
How to provision a nRF9160 DK with custom cloud credentials
View How to provision a nRF9160 DK with custom cloud credentials.md

How to provision a nRF9160 DK with custom cloud credentials using nRF Connect SDKs Asset Tracker sample.

In this example we want to provision the nRF9160 Development Kit with custom credentials to connect to an MQTT broker. For this guide we still want to connect it to nRF Connect for Cloud but as a new device.

Aquire a new certificate to connect to nRF Connect for Cloud

There is a section on connecting via MQTT to nRF Connect for Cloud in the handbook, but here are necessary steps in short:

Open the handbook and log in to with your nRF Connect for Cloud credentials. If you do not have an account, create a new one. (Note that you cannot use your DevZone account at the moment)

@coderbyheart
coderbyheart / lastframe.txt
Created Dec 19, 2018
"Mine Cart Madness" - Day 13 - Advent of Code 2018 https://adventofcode.com/2018/day/13 #AdventOfCode
View lastframe.txt
/-------------------------------------\
/----------------------------------\ /---------------+-------------------------------------+--------\
/+----------------------------------+-------------------+---------------+----------------------------------\ | |
|| /---------+-------------------+-\ /-----------+--------------\ | | | /--------\
|| /------+--\ | /------+-+-+-----------+--------------+--------------\ | | | | |
|| | | | |/-----------+------+-+-+-----------+--------------+--------------+----+--+--\ | | |
|| /---------------+------+--+------++-----------+--\ | | | | /-------+----\ | | | | | | |
|| | /---+------+--+-\ || | | |
@coderbyheart
coderbyheart / classes.ts
Last active Nov 29, 2018
Classes vs Functions (TypeScript and Dependency Injection)
View classes.ts
class FooManager {
private readonly barRepo: BarRepository
private readonly userPreferencesRepo: UserPreferencesRepository
constructor(barRepo: BarRepository, userPreferencesRepo: UserPreferencesRepository) {
this.barRepo = barRepo
this.userPreferencesRepo = userPreferencesRepo
}
async findMyFavoriteBar(user: User): Promise<Bar> {
const bars = await this.barRepo.findAll()
@coderbyheart
coderbyheart / clone-repos-with-filename.sh
Last active Oct 20, 2018
Batch clone repo containing certain filename
View clone-repos-with-filename.sh
GITHUB_USERNAME=coderbyheart
ACCESS_TOKEN=`cat ~/.netrc | grep "github.com login $GITHUB_USERNAME" | awk '{ print $6; }'`
ORGANIZATION=nrfcloud
FILENAME=buildspec.yml
# Clone them all
curl -u $GITHUB_USERNAME:$ACCESS_TOKEN -s https://api.github.com/search/code\?q=org%3A${ORGANIZATION}+filename%3A$FILENAME | jq ".items[].repository.full_name" -a | xargs -I{} git clone https://github.com/{}
You can’t perform that action at this time.