Skip to content

Instantly share code, notes, and snippets.

View sunng87's full-sized avatar
👑
keep calm and git push -f

Ning Sun sunng87

👑
keep calm and git push -f
View GitHub Profile
@elderica
elderica / sdrocm.md
Last active September 3, 2023 05:22
Stable Diffusion with ROCm and ArchLinux
  1. arch4edu リポジトリを追加する。
  2. paru -Syu rocm-hip-sdk rocm-opencl-sdk python-pytorch-rocm python-torchvision-rocm python-numpy yq
  3. virtualenv --system-site-packages sdenv
  4. source sdenv/bin/activate
  5. git clone https://github.com/CompVis/stable-diffusion.git && cd stable-diffusion
  6. yq '.dependencies[].pip?[]' environment.yaml | sed 's/"//g' | xargs -L1 pip install
  7. https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt からチェックポイントファイルを入手して、 models/ldm/stable-diffusion-v1/model.ckpt に置く
  8. python scripts/txt2img.py --prompt "a photograph of an astronaut riding a horse" --plms
(defun vulpea-project-p ()
"Return non-nil if current buffer has any todo entry.
TODO entries marked as done are ignored, meaning the this
function returns nil if current buffer contains only completed
tasks."
(seq-find ; (3)
(lambda (type)
(eq type 'todo))
(org-element-map ; (2)
public abstract class RightDrawableOnTouchListener implements OnTouchListener {
Drawable drawable;
private int fuzz = 10;
/**
* @param keyword
*/
public RightDrawableOnTouchListener(TextView view) {
super();
final Drawable[] drawables = view.getCompoundDrawables();
@killme2008
killme2008 / query_queue_length.rb
Created March 17, 2013 06:59
Query queue length in metaq.
####
# Description:a ruby script to monitor metaq queue size
# Requirements: zookeeper
# sudo gem install zookeeper
#
#####
require 'rubygems'
require 'zookeeper'
require 'socket'
@dakrone
dakrone / project.clj
Created February 16, 2012 18:01
lein-multi functionality with lein ver.2 profiles
∴ lein2 all test
Performing task 'test' with profile(s): 'dev,1.2'
Testing clj-http.test.client
Testing clj-http.test.cookies
Testing clj-http.test.core
Ran 47 tests containing 175 assertions.
@stuartsierra
stuartsierra / clojurescript-project.clj
Created January 20, 2012 18:04
project.clj for ClojureScript project
(defproject foo "1.0.0-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[org.clojure/clojure "1.3.0"]
[org.clojure/clojurescript "0.0-927"]])
@daveray
daveray / giant-steps.clj
Created November 24, 2011 04:52
First chorus of Giant Steps solo by Overtone
; Final pre-processed "transcriptions" of several Coltrane "Giant Steps" solos
; are here: https://github.com/daveray/yardbird
; Please take the data and do something fun with it!
; TODO
; Incorporate changes
; Convert to concert pitch
; Convert to correct octave
(use 'overtone.live)
@sunng87
sunng87 / clspark.lisp
Created November 18, 2011 02:37
spark in common lisp
#!/usr/bin/clisp
(defconstant ticks (list "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"))
(defun spark (data-list)
(let ((max-value (apply #'max data-list))
(ticks-length (length ticks)))
(let ((ticks-unit (/ max-value (- ticks-length 1))))
(map 'list (lambda (x) (elt ticks (ceiling (/ x ticks-unit)))) data-list))))
@mtigas
mtigas / gist:952344
Last active April 3, 2024 07:57
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

@sunng87
sunng87 / anonymous_class.py
Created April 29, 2011 06:08
Convert a python function to a Java anonymous class
#
# usage, convert this work method to a Runnable anonymous class
#
# @anonymous_class(Runnable, 'run')
# def work(dummy):
# print 'hello world'
#
# work.run()
#
import types