Skip to content

Instantly share code, notes, and snippets.

import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
@autobubenik
autobubenik / filename.txt
Created April 26, 2024 10:00
Unicorn Updated
Unicorn Updated
@lordneon
lordneon / steps.md
Last active April 26, 2024 09:58
UK Light Wiring with Shelly 1

Intro

This is a simple guide on how to automate UK lights with a Shelly 1 by installing the shelly 1 relay into the ceiling pendant which has both permanent live, neutral and a switched live back from the wall switch.

These steps are from my own experience making my lighting "smart" but also user friendly (it works via a wall switch!). This simple guide will go through replacing an a normal ceiling pendant with one with room for a Shelly 1. If you have a ceiling light with a bigger base it's even easier.

Warning Electrical regulations must be followed by law. If you are not a competent person under the regulations do not attempt electrical work. https://www.diydoctor.org.uk/projects/electrical_safety.htm

Wiring Diagram

This diagram has been taken from here and modified to include the Shelly 1. Wiring Diagram

@sheredom
sheredom / VkComputeSample
Created May 29, 2016 19:14
A simple Vulkan compute sample
// This is free and unencumbered software released into the public domain.
//
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
//
// In jurisdictions that recognize copyright laws, the author or authors
// of this software dedicate any and all copyright interest in the
// software to the public domain. We make this dedication for the benefit
@Tamal
Tamal / set-chroot.sh
Last active April 26, 2024 09:57
Setting up chroot from a live image in Fedora. Regenerate grub2 for Fedora.
$ # Use Live CD to boot
$ sudo su # Switch to root
$ fdisk -l # Get names of root, boot & EFI partition names. you can also use blkid
$ mount /dev/mapper/fedora_localhost--live-root /mnt # mount root partition
$ cat /mnt/etc/fedora-release
Fedora release 31 (Thirty One)
$ mount /dev/nvme0n1p2 /mnt/boot # mount boot partition
$ mount /dev/nvme0n1p1 /mnt/boot/efi # mount EFI partition
# Note: If you are not able to mount EFI partition ('Input/Output error'),
# You may have to repair ESP file system or format ESP.
@abidanBrito
abidanBrito / build-emacs.sh
Last active April 26, 2024 09:56
Build GNU Emacs from source.
#!/usr/bin/env bash
## Author: Abidán Brito
## This script builds GNU Emacs 29.1 with support for native elisp compilation,
## tree-sitter, libjansson (C JSON library), pure GTK and mailutils.
# Exit on error and print out commands before executing them.
set -euxo pipefail
# Let's set the number of jobs to something reasonable; keep 2 cores
@imba-tjd
imba-tjd / .Cloud.md
Last active April 26, 2024 09:55
☁️ 一些免费的云资源

IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装;PaaS提供语言环境和框架(可以自己选);SaaS只能使用开发好的软件(卖软件本身);BaaS一般类似于非关系数据库,但各家不通用,有时还有一些其它东西。

其他人的集合

@gabeno
gabeno / set_time_date.sh
Created June 23, 2015 10:08
A simple bash script to set time and date on ubuntu server
#!/bin/bash
#################################################################################################
# A simple script to set time and date on a ubuntu server #
# #
# Adapted from this short article: #
# https://www.garron.me/en/linux/set-time-date-timezone-ntp-linux-shell-gnome-command-line.html #
# #
# How to run: #
# 'sudo bash set_time_date.sh' #
@parmentf
parmentf / GitCommitEmoji.md
Last active April 26, 2024 09:53
Git Commit message Emoji
@HerringtonDarkholme
HerringtonDarkholme / nihongo.cpp
Last active April 26, 2024 09:52
g++ nihongo.cpp
#define エスティーディー std
#define アイオーストリーム <iostream>
#define ユージング using
#define イフ if
#define インクルード #include
#define イント int
#define シーアウト cout
#define シーイン cin
#define ネームスペース namespace
#define ブール bool