Skip to content

Instantly share code, notes, and snippets.

View skurovec's full-sized avatar

Jan Skurovec skurovec

View GitHub Profile
@looki
looki / outpainting.py
Created September 13, 2022 02:23
Simple CLI for parlance-zz's outpainting noise generation script
# Code extracted from https://github.com/parlance-zz/g-diffuser-bot/tree/g-diffuser-bot-diffuserslib-beta
#
# `pip install numpy image scikit-image` should cover all dependencies, but they are probably installed if you're using SD.
#
# The GitHub recommends a denoising strength of 0.6 and config scale of 10.
# I've found a bit higher values for the denoising strength to work better, ymmv
import os, sys
from PIL import Image
@Majkl578
Majkl578 / ArbitraryRun.php
Last active September 10, 2018 12:26
typed factory
<?php
declare(strict_Types=1);
namespace Example;
(function () : void {
$requestFactory = new class implements ServerRequestFactory {
public function __invoke() : ServerRequest
{

The project can be built using Lumo

npm install -g lumo-cljs
lumo build.cljs
const updateState = app => m => app.updateData(app.state.withMutations(m));
const cleanup = app => ::app.dispose;
export default function(apiUrl, gtmKey) {
const api = apiFactory(apiUrl);
const data = fromJS(appState);
return async (req, res, next) => {
try {
const app = new Application(data);
const routes = defRoutes(app);
@webdevilopers
webdevilopers / SubjectInsideFunctionAdmin.php
Last active February 14, 2023 14:07
How to use form event listener in Sonata Admin
<?php
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Form\FormMapper;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
class SubjectOutsideFunctionAdmin extends Admin
{
protected function configureFormFields(FormMapper $formMapper)
@milo
milo / github-webhook-handler.php
Last active July 26, 2023 15:29
GitHub Webhook Handler
<?php
/**
* GitHub webhook handler template.
*
* @see https://docs.github.com/webhooks/
* @author Miloslav Hůla (https://github.com/milo)
*/
$hookSecret = 's.e.c.r.e.t'; # set NULL to disable check
@loganlinn
loganlinn / history.cljs
Last active November 19, 2017 20:13
history.cljs
(ns history
"Light wrappers and utils for js/history")
(defn back! [] (.back js/history))
(defn forward! [] (.forward js/history))
(defn go! [idx] (.go js/history idx))
(defn replace-state!
@danielsz
danielsz / pushState.cljs
Last active July 15, 2016 15:13
PushState (via Html5History from google closure) with secretary, a client-side routing library for clojurescript. Allows to map absolute urls with routes without the hash-bang hackery.
(def history (Html5History.))
(.setUseFragment history false)
(.setPathPrefix history "")
(.setEnabled history true)
(let [navigation (listen history EventType/NAVIGATE)]
(go
(while true
(let [token (.-token (<! navigation))]
(secretary/dispatch! token)))))
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@stuartsierra
stuartsierra / errors.clj
Created April 20, 2012 14:27
Example error messages from common mistakes with Datomic
;; Some example error messages resulting from common mistakes
;; using Datomic 0.8.4138
(ns errors
(:use [datomic.api :as d :only (db q)]))
(def uri "datomic:mem://database")
(d/create-database uri)