Skip to content

Instantly share code, notes, and snippets.

View 5c077yP's full-sized avatar

Alexander Springer 5c077yP

View GitHub Profile
@flinox
flinox / produce_message_avro_through_api.sh
Last active December 6, 2020 06:55
Kafka: Produce message in avro format on a kafka topic through confluent REST proxy
-- PRODUCE MESSAGE AVRO
curl --request POST \
--url http://{{hostname_rest_proxy}}:8082/topics/topic-name \
--header 'accept: application/vnd.kafka.v2+json, application/vnd.kafka+json, application/json' \
--header 'content-type: application/vnd.kafka.avro.v2+json' \
--data '{
"value_schema": "{\"namespace\":\"br.com.flinox\",\"name\":\"course\",\"type\":\"record\",\"doc\":\"This schema defines a course\",\"aliases\":[\"class\",\"school\"],\"fields\":[{\"name\":\"course_source\",\"doc\":\"The system source of course\",\"type\":\"string\"},{\"name\":\"course_code\",\"doc\":\"The code of the course\",\"type\":\"int\"},{\"name\":\"course_name\",\"doc\":\"Name of the course\",\"type\":\"string\"},{\"name\":\"course_type\",\"doc\":\"Type of the course\",\"type\":\"string\"}]}",
"records": [
{
"value": {"course_source": "system_A", "course_code": 10, "course_name": "Information Systems", "course_type": "G"}
@alexbeletsky
alexbeletsky / auth.js
Last active June 7, 2016 14:15
Redux Thunk Async Action
import { actionRequest, requestFlow } from '../utils/axios';
import { push } from 'react-router-redux';
import constants from '../constants';
export function requestAuthUrl() {
return (dispatch) => {
const onBefore = () => {
dispatch({ type: constants.ACCOUNT_REQUESTING_AUTH_URL });
};
@5c077yP
5c077yP / ixgbevf-upgrade.sh
Last active August 29, 2015 14:27 — forked from vdm/ixgbevf-upgrade.sh
ixgbevf 2.16.1 upgrade for AWS EC2 SR-IOV "Enhanced Networking" on Ubuntu 14.04 (Trusty) LTS
#!/usr/bin/env bash
set -e
set -o pipefail
# globals
readonly VERSION='2.16.1'
readonly DOWNLOAD_URL='http://sourceforge.net/projects/e1000/files/ixgbevf%20stable/2.16.1/ixgbevf-2.16.1.tar.gz'
readonly INSTALL_DIR='/usr/src' # must be here for dkms
@vdm
vdm / ixgbevf-upgrade.sh
Last active November 28, 2019 21:35
ixgbevf 2.16.1 upgrade for AWS EC2 SR-IOV "Enhanced Networking" on Ubuntu 14.04 (Trusty) LTS
ssh ubuntu@n.n.n.n "bash -s -x" -- <ixgbevf-upgrade.sh
@mjackson
mjackson / color-conversion-algorithms.js
Last active June 8, 2024 01:27
RGB, HSV, and HSL color conversion algorithms in JavaScript
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation