Skip to content

Instantly share code, notes, and snippets.

@rain-1
rain-1 / organize images using AI.md
Last active October 11, 2024 13:24
organize images using AI

Organize Images into folders using AI

This is a tool that sorts images into folders using "AI". You create the folders you want the images to be put into.

I got 'claude' to write with a couple prompts. Make venv and install deps with pip.

dynamic configuration.

as discussed in slack i've written down my thoughts on a more dynamic config and what it could be good for to open the discussion. depending on the inputs i'd be happy to research more.

rationale

as more and more setups use cluster orchestration frameworks (such as e.g. kubernetes), h2o makes an excellent candidate for a loadbalancer / ingress controler. however in this type of setup, whenever a new new service is deployed the loadbalancer needs to be quickly updated

# Maintainer: Yannick Koechlin <[email protected]>
pkgname=h2o-future
pkgver=r3959.4bc17f98
pkgrel=1
pkgdesc="Optimized HTTP server with support for HTTP/1.x and HTTP/2. git version with extra gems"
arch=('i686' 'x86_64')
depends=('libuv' 'libyaml' 'wslay' 'zlib' 'sqlite3' 'leveldb' 'hiredis' 'librdkafka-git' 'nghttp2' 'curl' 'mbedtls')
makedepends=('cmake' 'libtool' 'make' 'pkg-config' 'ruby')
url="https://github.com/h2o/h2o"
@simonhf
simonhf / hardest.c
Last active January 2, 2018 01:53
experiments with tarantool transactions, fibers, and C box_insert (because Lua string performance sucks)
#include "module.h"
#define MP_SOURCE 1 /* define in a single .c/.cc file */
#include "msgpuck.h"
// https://tarantool.org/doc/tutorials/c_tutorial.html?highlight=stored%20procedure
// CPATH=/usr/include/tarantool/:/usr/include/ gcc -shared -o hardest.so -fPIC hardest.c
char * key_format = "the quick brown fox jumped over the lazy dog the qu %07u ick brown fox ";
char * field_2 = "'{\"0\":{\"1234567890\": 320, \"1234567890\": 1303}}'";
@alekseykulikov
alekseykulikov / index.md
Last active October 12, 2024 17:02
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@j8
j8 / disable all macos animations
Last active November 15, 2024 03:47
disable all macos animations for high performance
defaults write -g NSScrollViewRubberbanding -int 0
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
defaults write -g NSScrollAnimationEnabled -bool false
defaults write -g NSWindowResizeTime -float 0.001
defaults write -g QLPanelAnimationDuration -float 0
defaults write -g NSScrollViewRubberbanding -bool false
defaults write -g NSDocumentRevisionsWindowTransformAnimation -bool false
defaults write -g NSToolbarFullScreenAnimationDuration -float 0
defaults write -g NSBrowserColumnAnimationSpeedMultiplier -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
@lloydzhou
lloydzhou / nginx.conf
Last active April 25, 2022 06:02
nginx srcache module to server stale data, using lua-resty-lock to make one request to create new cache, and using "lua-resty-http" + "ngx.timer.at" to update new cache in background.
upstream www {
server 127.0.0.1:9999;
}
upstream redis {
server 127.0.0.1:6379;
keepalive 1024;
}
lua_shared_dict srcache_locks 100k;
server {
@austinhyde
austinhyde / js-observables-binding.md
Last active August 16, 2023 18:19
Vanilla JavaScript Data Binding

Observables

You don't really need a framework or fancy cutting-edge JavaScript features to do two-way data binding. Let's start basic - first and foremost, you need a way to tell when data changes. Traditionally, this is done via an Observer pattern, but a full-blown implementation of that is a little clunky for nice, lightweight JavaScript. So, if native getters/setters are out, the only mechanism we have are accessors:

var n = 5;
function getN() { return n; }
function setN(newN) { n = newN; }

console.log(getN()); // 5

setN(10);