Skip to content

Instantly share code, notes, and snippets.

@erikyuzwa
erikyuzwa / wordpress-6-2-2-docker-compose.yml
Last active April 20, 2024 08:13
Wordpress 6.2.2 Docker Compose for Local Development
# create a local .env file with the following 4 properties:
#
# MYSQL_DATABASE=<something>
# MYSQL_USER=<something>
# MYSQL_PASSWORD=<something>
# MYSQL_ROOT_PASSWORD=<something>
#
# Note: I have had a LOT of issues working with anything newer then Docker Desktop v4.26.1
# If you're on something newer, then double check against this release.
#
@paradite
paradite / LICENSE
Last active April 20, 2024 08:12
d3.js range selection using drag
MIT License
Copyright (c) 2020 Zhu Liang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

Two approaches to handle error responses from Spring WebClient calls globally:

  • Exceptions with webclients are all wrapped in WebClientResponseException class. So we can handle that using Spring's ExceptionHandler annotation.

  • Using ExchangeFilterFunction while constructing the webclient bean.

@andyblac
andyblac / low-battery-and-unavailable-check.yaml
Last active April 20, 2024 08:08 — forked from kurohouou/low-battery-and-unavailable-check.yaml
Home Assistant Blueprint: Low battery level detection & notification for all battery sensors
blueprint:
# Version: 1.3.1
name: Low Battery and Device Unavailable Check
description:
Regularly test all sensors with 'battery' device-class for crossing
a certain battery level threshold as well as if it is unavailable.
domain: automation
input:
threshold:
name: Battery warning level threshold
@hhanh00
hhanh00 / reverse-ws-proxy.js
Created June 24, 2015 15:05
Reverse Proxy for websockets using Express JS
var http = require('http'),
httpProxy = require('http-proxy'),
express = require('express');
// create a server
var app = express();
var proxy = httpProxy.createProxyServer({ target: 'http://localhost:8080', ws: true });
var server = require('http').createServer(app);
// proxy HTTP GET / POST
@squarestar
squarestar / install-wp-plugins.php
Last active April 20, 2024 08:02
Programmatically install and activate wordpress plugins
<?php
/**
* Programmatically install and activate wordpress plugins
*
* Usage:
* 1. Edit the $pluginSlugs array at the beginning of this file to include the slugs of all the
* plugins you want to install and activate
* 2. Upload this file to the wordpress root directory (the same directory that contains the
* 'wp-admin' directory).
* 3. Navigate to <your-domain-wordpress-root>/install-wp-plugins.php (If wordpress is installed
@agnelnieves
agnelnieves / commit-styleguide.md
Last active April 20, 2024 08:01
Commit Styleguide

Commit Style Guide

Introduction

This styleguide was created for personal reference, feel free to fork this gist and use it on your own projects. The purpose of this styleguide is to provide more readable and consistent git commits in your projects.

Commit Messages

Message Structure

@frk1
frk1 / ipv4.txt
Last active April 20, 2024 08:01
Get Netflix IP ranges
# 2017-10-01T14:14:44+00:00
108.175.32.0/20
108.175.34.0/24
108.175.35.0/24
192.173.64.0/18
198.38.100.0/24
198.38.101.0/24
198.38.108.0/24
198.38.109.0/24
@kohya-ss
kohya-ss / gradio_llm.py
Last active April 20, 2024 08:00
gradioでLLMを利用する簡易クライアント
# Apache License 2.0
# 使用法は gist のコメントを見てください
import argparse
from typing import List, Optional, Union, Iterator
from llama_cpp.llama_chat_format import _convert_completion_to_chat, register_chat_completion_handler
import llama_cpp.llama_types as llama_types
from llama_cpp.llama import LogitsProcessorList, LlamaGrammar
from llama_cpp import Llama, llama_chat_format
import gradio as gr
@hakre
hakre / imap-attachment.php
Created April 11, 2012 22:50
Save attachments from imap messages to disk.
<?php
/**
* imap-attachment.php
*
* @author hakre <hakre.wordpress.com>
* @link http://stackoverflow.com/questions/9974334/how-to-download-mails-attachment-to-a-specific-folder-using-imap-and-php
*/
/**
* Utility Class