Skip to content

Instantly share code, notes, and snippets.

@mmn80
mmn80 / detect_kbd_devices.c
Created December 19, 2012 14:43 — forked from anonymous/detect_kbd_devices.c
Uses libudev to detect all keyboard input event devices (/dev/input/eventX). Based on the /usr/lib/udev/findkeyboards script.
#include <libudev.h>
#define MAX_KBD_DEVICES 10
const char** detect_kbd_devices()
{
const char **devnodes = calloc(MAX_KBD_DEVICES, sizeof(char*));
struct udev *udev;
struct udev_enumerate *enumerate;
struct udev_list_entry *devices, *dev_list_entry;
struct udev_device *dev;
@define-private-public
define-private-public / HttpServer.cs
Last active May 15, 2024 12:09
A Simple HTTP server in C#
// Filename: HttpServer.cs
// Author: Benjamin N. Summerton <define-private-public>
// License: Unlicense (http://unlicense.org/)
using System;
using System.IO;
using System.Text;
using System.Net;
using System.Threading.Tasks;
@ghost1372
ghost1372 / publish.yml
Last active May 15, 2024 12:06
I use this action to publish project, compress to Zip and upload to GitHub release
name: "Publish"
on:
push:
tags:
- "v*"
env:
PROJECT_PATH: WpfApp6/WpfApp6.csproj
ZIP_PATH: WpfApp6/bin/Release/net5.0-windows/win-x86/publish/WpfApp6-Portable.zip
@safa-dayo
safa-dayo / sd-webui-google-colab-setup.sh
Last active May 15, 2024 12:05
Stable Diffusion web UI(最新版)をGoogle Colabで起動するためのコマンド。こちらのコマンドを自身のGoogle Colabノートブックにコピーした後、利用したいモデルや拡張機能、LoRAなどにチェックを入れた上で実行ボタンを押すことで、設定した内容でStable Diffusion web UIが起動します。
#@title Stable Diffusion web UI(最新版)をGoogle Colabで起動するためのコマンド
#@markdown ## このColabノートブックについて
#@markdown [Stable Diffusion web UI](https://github.com/AUTOMATIC1111/stable-diffusion-webui) をGoogle Colabで起動するためのノートブックとなります。
#@markdown 利用したいモデルや拡張機能、LoRAなどにチェックを入れた上で実行ボタンを押すことで、設定した内容でStable Diffusion web UIが起動します。
#@markdown また各項目には公式ページへのリンクをつけています。利用の際は公式ページよりライセンスなどを確認した上でご利用ください。
### Stable Diffusion web UIインストール
@thefish
thefish / utf8-win1251
Created May 21, 2013 08:31
JS utf-8 to windows-1251 string converter
//utf8 to 1251 converter (1 byte format, RU/EN support only + any other symbols) by drgluck
function utf8_decode (aa) {
var bb = '', c = 0;
for (var i = 0; i < aa.length; i++) {
c = aa.charCodeAt(i);
if (c > 127) {
if (c > 1024) {
if (c == 1025) {
c = 1016;
} else if (c == 1105) {
@laolaofireduck
laolaofireduck / Entity.cs
Created May 15, 2024 10:28
LINQ dynamic select extension method
public class Entity : DynamicObject, IDictionary<string, object>
{
private readonly IDictionary<string, object> _expando = null;
public Entity()
{
_expando = new ExpandoObject();
}
public override bool TryGetMember(GetMemberBinder binder, out object result)
@Barneybook
Barneybook / Telegram_it_group_list.md
Last active May 15, 2024 12:02
Telegram 資訊相關 群組清單
@lbruder
lbruder / lbForth.c
Created April 6, 2014 15:21
A minimal Forth compiler in ANSI C
/*******************************************************************************
*
* A minimal Forth compiler in C
* By Leif Bruder <leifbruder@gmail.com> http://defineanswer42.wordpress.com
* Release 2014-04-04
*
* Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial
*
* PUBLIC DOMAIN
*
@wgross
wgross / get-registry-property-value.ps1
Created September 22, 2021 08:46
Fetches Key name, property name and property value from registry keys
Get-ChildItem . | Foreach-Object {
# this is done foreach reg key
$regKey = $_;
# property is a list of properties of the registry key
$_.Property | ForEach-Object -Process {
[PScustomobject]@{
Key =$regKey.Name
Property=$_
# Value is returned as a complex object extsnded with sevaral PS properties.
@sunsided
sunsided / etc-docker-daemon.json
Created February 29, 2020 13:48
WIFIonICE vs Docker: Fixing DB (Deutsche Bahn) WIFI by moving Docker away from 172.18.x.x in /etc/docker/daemon.json
{
"bip": "172.39.1.5/24",
"fixed-cidr": "172.39.1.0/25",
"runtimes": {
"nvidia": {
"path": "nvidia-container-runtime",
"runtimeArgs": []
}
}
}