Skip to content

Instantly share code, notes, and snippets.

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

Julian Kern Keyes

🏠
Working from home
View GitHub Profile
@Keyes
Keyes / free_beds.js
Last active October 7, 2022 06:41
Widget für die Zahl der freien Intensiv-Betten für iOS innerhalb Deutschlands 🇩🇪
// Licence: juliankern.com; CC BY 3.0 DE
const C = { layout: 'simple' };
(async () => new Function(await new Request('https://cdn.jsdelivr.net/gh/Keyes/its-beds-widget/widget.min.js').loadString())(C))();
import { render, screen } from '@testing-library/react';
import React from 'react';
import Button from '.';
const testMessage = 'Test Message';
let container;
describe('basic functionality', () => {
beforeEach(() => {
@Keyes
Keyes / ButtonReadme.md.txt
Last active September 21, 2020 14:59
Example readme file for button component in ThomannUI via React-Styleguidist
Button appearances examples with onClick event:
white:
```js
<Button href="test" appearance="white" title="Button title" onClick={alert.bind(null, 'onClick triggered!')}>Button text</Button> 
<Button href="test" appearance="white" title="Button title" disabled onClick={alert.bind(null, 'onClick triggered!')}>Disabled Button text</Button>
```
light:
```js
//#include <Adafruit_NeoPixel.h>
// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1:
#define LED_PIN 6
// How many NeoPixels are attached to the Arduino?
#define LED_COUNT 12
// Declare our NeoPixel strip object:
<picture>
<source srcset="/images/image-496.webp, /images/image-992.webp 2x" type="image/webp" media="(min-width: 992px)" />
<source srcset="/images/image-496.jpg, /images/image-992.jpg 2x" media="(min-width: 992px)" />
<source srcset="/images/image-1000.webp, /images/image-2000.webp 2x" type="image/webp" media="(min-width: 500px)" />
<source srcset="/images/image-1000.jpg, /images/image-2000.jpg 2x" media="(min-width: 500px)" />
<source srcset="/images/image-500.webp, /images/image-1000.webp 2x" type="image/webp" />
<source srcset="/images/image-500.jpg, /images/image-1000.jpg 2x" />
<img src="/images/image-preview.jpg" />
</picture>
@Keyes
Keyes / svgicon.css
Last active September 27, 2019 13:15
Basic css for inline svg's
.svg-icon {
width: 50px;
height: 50px;
color: gray;
background-color: transparent;
display: inline-block;
box-sizing: border-box;
}
.svg-icon svg {
@Keyes
Keyes / svgicon.css
Created September 26, 2019 09:16
Basic css for inline svg's
.svg-icon {
width: 50px;
height: 50px;
color: gray;
background-color: transparent;
display: inline-block;
box-sizing: border-box;
}
.svg-icon svg {
@Keyes
Keyes / thermostat.js
Created October 10, 2018 22:50
Very simple thermostat written in Node.js
const sensor = require('ds1820-temp');
const gpio = require('rpi-gpio');
const CHECK_INTERVAL = 30 * 1000 // every 30s
const GPIO_PORT = 13;
const SENSOR_ID = '0000067bdac4';
setInterval(checkTemperature, CHECK_INTERVAL);
async function checkTemperature() {
function hsi2rgbw(H, S, I) {
let rgbw = {}, cos_h, cos_1047_h;
H = H % 360;
H = Math.PI * H / 180;
S = S > 0 ? (S < 1 ? S : 1) : 0;
I = I > 0 ? (I < 1 ? I : 1) : 0;
if(H < 2.09439) {
@Keyes
Keyes / .bash_profile
Last active August 28, 2018 06:20
Bash prompt including package + version and git branch
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
export NODE_ENV=development
alias l="ls -lisa"
alias gs="grunt serve"
alias gb="grunt build"
alias clone="git clone $1 $2"
alias branch="git branch $1 $2 $3"