Skip to content

Instantly share code, notes, and snippets.

View db0's full-sized avatar
🎯
Providing generative AI for everyone via the AI Horde

Divided by Zer0 db0

🎯
Providing generative AI for everyone via the AI Horde
View GitHub Profile
@db0
db0 / join_horde_team.sh
Created November 5, 2022 01:22
Use the below script to join the official team of the stable horde.
APIKEY=PUT_YOUR_API_KEY_HERE # Put your Horde API key here
WORKER=PUT_YOUR_WORKER_ID_HERE # Put your Worker ID here
curl -X 'PUT' \
"https://stablehorde.net/api/v2/workers/${WORKER}" \
-H 'accept: application/json' \
-H "apikey: ${APIKEY}" \
-H 'Content-Type: application/json' \
-d '{
"team": "7a5afb3e-6d80-41f0-98bd-9be732d45944"
}'
@db0
db0 / change_ubuntu_background.sh
Created October 10, 2022 12:57
tiny bash script to change your ubuntu background through stable diffusion. No dependencies. Run anywhere with access to internet
PROMPT="a cat on the street of cyberpunk nightlife in sydney wide desktop background purple and blue neon lights"
curl -X POST -H "Content-Type: application/json" -H "apikey:0000000000" -d "{\"prompt\":\"${PROMPT}\",\"params\":{\"width\":1024,\"height\":704}}" https://stablehorde.net/api/v2/generate/sync -o f.json
sed 's|.*"img": "\([^"]*\)".*|\1|' f.json > ff.txt
base64 -d ff.txt > p.webp
dwebp p.webp -o p.png
readlink -e p.png | { read test; gsettings set org.gnome.desktop.background picture-uri file://$test; }
<Dictionary name="Root" type="System.Collections.Hashtable, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<Items>
<Item>
<Simple type="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" value="CleanDatabase" />
<Simple type="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" value="False" />
</Item>
<Item>
<Simple type="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" value="FilterGames_Star Wars: The Card Game" />
<Simple type="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" value="true" />
</Item>
@db0
db0 / gist:3822679
Created October 2, 2012 19:19
Timer WinForms in OCTGN workaround
class OKWindow(Form): # This is a WinForm which creates a simple window, with some text and an OK button to close it.
def __init__(self,InfoTXT):
self.StartPosition = FormStartPosition.CenterScreen
(STRwidth, STRheight) = calcStringLabelSize(InfoTXT)
FORMheight = 130 + STRheight
FORMwidth = 100 + STRwidth
self.Text = 'Information'
self.Height = FORMheight
self.Width = FORMwidth
self.AutoSize = True
@db0
db0 / gist:3813149
Created October 1, 2012 17:21
idea for solving WinForms crash
try:
import clr
clr.AddReference("System.Drawing")
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import Application, Form, Button, Label, DockStyle, AnchorStyles, FormStartPosition, RadioButton, Panel
from System.Drawing import Color
except:
Automations['WinForms'] = False
@db0
db0 / gist:3769877
Created September 23, 2012 11:37
MultiChoice IronPython WinForm
class MultiChoiceWindow(Form):
def __init__(self, FormTitle, FormChoices):
self.Text = "Select an Option"
self.index = 0
self.MinimizeBox = False
self.MaximizeBox = False
self.StartPosition = FormStartPosition.CenterScreen
self.AutoSize = True
self.BringToFront()
@db0
db0 / gist:3768405
Created September 23, 2012 00:56
Updated RadioForm
class RadioWindow(Form):
def __init__(self, BoxTitle, BoxOptions):
self.Text = "Select an Option"
self.index = 0
self.confirmValue = None
self.MinimizeBox = False
self.MaximizeBox = False
self.StartPosition = FormStartPosition.CenterScreen
self.AutoSize = True
@db0
db0 / gist:3767055
Created September 22, 2012 17:39
iteration of OK form for OCTGN
import clr
clr.AddReference("System.Drawing")
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import Application, Form, Button, Label, DockStyle, AnchorStyles, FormStartPosition
class OKWindow(Form):
def __init__(self,InfoTXT):
newlines = 0
self.StartPosition = FormStartPosition.CenterScreen
@db0
db0 / gist:3766684
Created September 22, 2012 16:35
First working iteration of OK form for OCTGN
import clr
clr.AddReference("System.Drawing")
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import Application, Form, Button, Label, DockStyle, AnchorStyles, FormStartPosition
class OKWindow(Form):
def __init__(self,InfoTXT):
newlines = 0
self.StartPosition = FormStartPosition.CenterScreen
@db0
db0 / gist:3766491
Created September 22, 2012 15:16
Window
import clr
clr.AddReference("System.Drawing")
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import Application, Form, Button, Label, DockStyle, AnchorStyles
class OKWindow(Form):
def __init__(self,InfoTXT):
newlines = 0
for char in InfoTXT: