Skip to content

Instantly share code, notes, and snippets.

View exocode's full-sized avatar
🏠
Working from home

Jan exocode

🏠
Working from home
View GitHub Profile
@exocode
exocode / [...nextauth].ts
Created September 27, 2022 18:05 — forked from RafalFilipek/[...nextauth].ts
Hasura + next-auth
import NextAuth, { type NextAuthOptions } from "next-auth";
import { JWT } from "next-auth/jwt";
import * as jwt from "jose";
export const authOptions: NextAuthOptions = {
// the rest is just like in tutorials. Session, callbacks etc.
jwt: {
encode: async ({ secret, token }) => {
if (!token) {
console.warn("encode: No token provided");
@exocode
exocode / gist:3145e38ba4b797666fba0abd3fef381d
Created March 26, 2021 15:18 — forked from kostia/gist:4075236
German synonyms for Elasticsearch
This file has been truncated, but you can view the full file.
80470 => 80470
ABC => ABC
ABM => ABM
ACL => ACL
ACPI => ACPI
ADAC => ADAC
ADSL => ADSL
AEG => AEG
AG => AG
AGP => AGP
@exocode
exocode / example_activejob.rb
Created October 14, 2019 17:34 — forked from ChuckJHardy/example_activejob.rb
Example ActiveJob with RSpec Tests
class MyJob < ActiveJob::Base
queue_as :urgent
rescue_from(NoResultsError) do
retry_job wait: 5.minutes, queue: :default
end
def perform(*args)
MyService.call(*args)
end
@exocode
exocode / appify
Created June 20, 2019 05:46 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@exocode
exocode / thermostat_example_with_dht_11.ino
Created May 24, 2019 15:20 — forked from kakopappa/thermostat_example_with_dht_11.ino
setSetTemperatureSettingOnServer.ino fix
/*
Version 0.1 - Jan 05 2019
*/
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <WebSocketsClient.h> // https://github.com/kakopappa/sinric/wiki/How-to-add-dependency-libraries
#include <ArduinoJson.h> // https://github.com/kakopappa/sinric/wiki/How-to-add-dependency-libraries
#include <StreamString.h>
apiVersion: v1
kind: Namespace
metadata:
name: gitlab-managed-apps
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: gitlab-sa
namespace: gitlab-managed-apps
@exocode
exocode / gitlabaccount.yaml
Last active March 26, 2019 11:50 — forked from chrisurwin/gitlabaccount.yaml
Gitlab Yaml for Rancher Server 2.0
apiVersion: v1
kind: Namespace
metadata:
name: gitlab-apps
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: gitlab-sa
namespace: gitlab-apps
@exocode
exocode / get_kubeconfig_custom_cluster_rancher2.sh
Created March 25, 2019 22:06 — forked from superseb/get_kubeconfig_custom_cluster_rancher2.sh
Get kubeconfig for custom cluster in Rancher 2.0/2.1
#!/bin/bash
# Usage: ./get_kubeconfig_custom_cluster_rancher2.sh cluster_name
# Needs to be run on the server running `rancher/rancher` container
# Check if jq exists
command -v jq >/dev/null 2>&1 || { echo "jq is not installed. Exiting." >&2; exit 1; }
# Check if clustername is given
if [ -z "$1" ]; then
echo "Usage: $0 [clustername]"
@exocode
exocode / notes.md
Last active February 22, 2019 12:17 — forked from jdevoo/notes.md
Mainflux Demo

Mainflux Demo

intro

The Mainflux domain model is based around 3 entities: users, things and channels

user represents the real (human) user of the system

things represents devices and applications connected to Mainflux. There are two types of "things" supported at the moment: device and app. Device is used to represent any physical device connected to the platform. App represents any 3rd party service that uses the platform for message exchange with things.

channel represents a communication channel and serves as message topic that can be consumed by things connected to it