Skip to content

Instantly share code, notes, and snippets.

@k0ff33
k0ff33 / docker-compose.yml
Created February 7, 2023 19:30
Docker Compose: Home Assistant with mosquitto & zigbee2mqtt (CC2652P)
version: '3.8'
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
ports:
- "8123:8123"
volumes:
- /var/docker/homeassistant:/config
- /etc/localtime:/etc/localtime:ro
@k0ff33
k0ff33 / gifenc.sh
Created December 10, 2020 22:04
Convert and optimise video to gif
#!/usr/bin/env bash
set -e
usage="usage: gifenc [input.mov] [output.gif] [resolution] [fps]"
if [ $# -ne 4 ]; then
echo "$usage"
exit 1
fi
@k0ff33
k0ff33 / .hyper.js
Created July 18, 2019 21:07
My Hyper config file
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@k0ff33
k0ff33 / Vscode extensions
Created July 16, 2017 13:40
Vscode extensions
EditorConfig.EditorConfig
HookyQR.beautify
HvyIndustries.crane
PeterJausovec.vscode-docker
annsk.alignment
chenxsan.vscode-standardjs
davidmart.theme-jsfiddle-like-syntax-vscode
dbaeumer.vscode-eslint
donjayamanne.githistory
eg2.tslint
@k0ff33
k0ff33 / settings.json
Created July 16, 2017 13:38
Vscode settings
{
"workbench.iconTheme": "vscode-icons",
"beautify.HTMLfiles": [
"htm",
"html",
"php"
],
"vsicons.projectDetection.autoReload": true,
"editor.minimap.enabled": true,
"editor.minimap.maxColumn": 80,
@k0ff33
k0ff33 / OddOccurrencesInArray.js
Last active March 30, 2022 15:59
Odd Occurrences In Array exercise from Codility (JavaScript/NodeJS)
/**
* Finds element without a pair in an unsorted array of integers
* @param {array} A
* @return {int} element without a pair
*/
function solution(A) {
let result = 0;
for (let element of A) {
// Apply Bitwise XOR to the current and next element
@k0ff33
k0ff33 / CyclicRotation.js
Last active January 6, 2024 17:19
Cyclic Rotation Exercise from Codility (JavaScript/NodeJS)
/**
* Shift items in the array to the right by number of indexes
* @param {array} A
* @param {int} K
* @return {array}
*/
function solution(A, K) {
// if A is meant to be shifted by its own length (K) then just return the array
if (A.length === K || K === 0) {
return A
@k0ff33
k0ff33 / BinaryGap.js
Last active July 6, 2019 16:51
Binary Gap Exercise from Codility (JavaScript/NodeJS)
/**
* Function which calculates the binary gap of the integer N
* @param {int} N
* @return {int} result
*/
function solution(N) {
// Convert decimal to binary
let binary = (N >>> 0).toString(2)
@k0ff33
k0ff33 / .zshrc
Last active October 13, 2021 13:01
My zsh configuration file
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/kamilwojtczyk/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="cobalt2"