Skip to content

Instantly share code, notes, and snippets.

View ghosthamlet's full-sized avatar

hamlet ghosthamlet

  • The Rest Is Silence of Code
View GitHub Profile
@FurkanGozukara
FurkanGozukara / 0 How to convert a real video into an animation - anime video by using Stable Diffusion and Automatic1111 Web UI
Last active September 4, 2024 07:48
How to convert a real video into an animation - anime video by using Stable Diffusion and Automatic1111 Web UI
Video tutorial of this gist file : https://www.youtube.com/watch?v=kmT-z2lqEPQ
Used web UI commit hash id: a9eef1fbb1dcdce4f0eb0b8e0f79dcd4c96713e1
Used ControlNet commit hash id : 241c05f8c9d3c5abe637187e3c4bb46f17447029
git checkout a9eef1fbb1dcdce4f0eb0b8e0f79dcd4c96713e1
git checkout master
;;; Fractional set cover solver with adahedge for the dual surrogate multiplers.
(defpackage "FRACTIONAL-SET-COVER"
(:use "CL"))
(in-package "FRACTIONAL-SET-COVER")
(deftype dvec () `(simple-array double-float 1))
(defstruct tour
(index (error "index must be provided")
@chrispsn
chrispsn / kOS.md
Last active June 1, 2024 12:38
A summary of everything we know about kOS.
@antirez
antirez / lmdb.tcl
Created April 28, 2017 15:40
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <[email protected]>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
@piotr-yuxuan
piotr-yuxuan / math-and-simple-call-in-core-logic.clj
Created January 16, 2016 16:10
Learning try-and-diy: how can I simplify this example?
(ns firstshot.chessknightmove
(:refer-clojure :exclude [== >= <= > < =])
(:use clojure.core.logic
clojure.core.logic.arithmetic))
(defn knight-moves
"Returns the available moves for a knight (on a 8x8 grid) given its current position."
[x y]
(let [xmax 8 ymax 8]
(run* [q]
@chrismdp
chrismdp / s3.sh
Last active September 13, 2024 12:53
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@runexec
runexec / Clojure Does Objects Better.clj.md
Last active June 17, 2020 03:47
Clojure Does Objects Better

Clojure does Objects Better

A hopefully short and concise explanation as to how Clojure deals with Objects. If you already write Clojure, this isn't for you.

You know what an Interface is if you write/read Java or PHP 5+. In Clojure it might be called defprotocol.

user> (defprotocol IABC
        (also-oo [this])
        (another-fn [this x]))

IABC

@chrisdone
chrisdone / AnIntro.md
Last active October 29, 2024 15:34
Statically Typed Lisp

Basic unit type:

λ> replTy "()"
() :: ()

Basic functions:

(require '[clojure.core.async :as a])
(def xform (comp (map inc)
(filter even?)
(dedupe)
(flatmap range)
(partition-all 3)
(partition-by #(< (apply + %) 7))
(flatmap flatten)
(random-sample 1.0)
@ctford
ctford / lenses.clj
Created July 12, 2014 20:40
A Clojure lens implementation based on focus and fmap.
(ns shades.lenses)
; We only need three fns that know the structure of a lens.
(defn lens [focus fmap] {:focus focus :fmap fmap})
(defn view [x {:keys [focus]}] (focus x))
(defn update [x {:keys [fmap]} f] (fmap f x))
; The identity lens.
(defn fapply [f x] (f x))
(def id (lens identity fapply))