Skip to content

Instantly share code, notes, and snippets.

View volker48's full-sized avatar
💭
🚀

Marcus McCurdy volker48

💭
🚀
View GitHub Profile
@volker48
volker48 / find_noise.py
Created September 14, 2022 14:53 — forked from trygvebw/find_noise.py
A "reverse" version of the k_euler sampler for Stable Diffusion, which finds the noise that will reconstruct the supplied image
import torch
import numpy as np
import k_diffusion as K
from PIL import Image
from torch import autocast
from einops import rearrange, repeat
def pil_img_to_torch(pil_img, half=False):
image = np.array(pil_img).astype(np.float32) / 255.0
@volker48
volker48 / input.txt
Created December 22, 2021 23:04
input
-7
+16
+5
+11
+18
-14
+11
+14
-2
+13
@volker48
volker48 / mp10mini.gcode
Last active November 19, 2021 04:56
Monoprice MP10 Mini start gcode
; Some of this comes from DrVax Monoprice M10 Start Code with some modifications by volker48
G21 ;(metric values)
G90 ;(absolute positioning)
M82 ;(set extruder to absolute mode)
M107 ;(start with the fan off)
M104 S[first_layer_temperature] ; set extruder temp
M140 S[first_layer_bed_temperature] ; set bed temp
M190 S[first_layer_bed_temperature] ; wait for bed temp
M109 S[first_layer_temperature] ; wait for extruder temp
G28 ;(Home all axes)
@volker48
volker48 / test_lock.py
Last active February 18, 2020 13:18
test fast api event loop blocking code
import time
from fastapi import FastAPI
app = FastAPI()
@app.get("/fast")
async def fast():
return {"message": "i was fast"}
@volker48
volker48 / minimal_example.py
Created September 21, 2017 18:53
XGBoost model dump issue
# coding: utf-8
# In[ ]:
import numpy as np
import pandas as pd
import xgboost as xgb
from scipy.sparse import csr_matrix
@volker48
volker48 / id_rsa.pub
Created September 28, 2016 00:27
ssh public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXPav9z1wI47r7c6LY9bbwZM2Y7YexdiQ+NVPYaz25QX2MWohCeJNiev+svnd2o0WfBxqoWvjC9vtjU8ho8glcTQSsQs7B8npNsO8POpY9kMMR9ds2ypdtQUvrqpAQfZrW+xUKbgjzhZxhjG9h4RTkX0t/Mv8Heht44yn/1RK7oCDzs2pb1NaeOItY4d2VfgrrCIonVFhUf2l8t5OYZDOCm9R9Yu4whmmpLFh6mFmNLMPPV2/SmUOrw7iMO5CFsZz1Np1FjMEFYWnWOjlZQYAAVEzcSnPA6j/Hhp2sER/P8WVOnt/+WkQctvuUMNIN+Kjn9oLx492xsqCuyWXvbD03 marcus@squatobot
@volker48
volker48 / goroutine.go
Created April 25, 2016 15:49
Simple goroutine with bug
package main
import (
"log"
"time"
)
func main() {
// anonymous function
go func() {
@volker48
volker48 / optimize.sh
Last active December 4, 2015 00:51 — forked from ryansully/optimize.sh
Optimized image optimization script (pngcrush & jpegtran)
#!/bin/sh
# script for optimizing images in a directory (recursive)
# pngcrush & jpegtran settings from:
# http://developer.yahoo.com/performance/rules.html#opt_images
# pngcrush
for file in `find -E . -regex '.*\.(jpg|png)'`; do
if [ ${file: -4} == ".png" ]
then

Keybase proof

I hereby claim:

  • I am volker48 on github.
  • I am marcusmccurdy (https://keybase.io/marcusmccurdy) on keybase.
  • I have a public key whose fingerprint is E3B1 C64D 9433 6BEC 7F0C 4139 7369 B29E 7655 B659

To claim this, I am signing this object:

@volker48
volker48 / tail.py
Last active October 9, 2015 04:18
Basic Python implementation of the unix tail command
#! /usr/bin/env python
'''
Copyright (c) 2012 Marcus McCurdy
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: