Skip to content

Instantly share code, notes, and snippets.

View tyzero's full-sized avatar
🎯
code make me cry😕

Awsl tyzero

🎯
code make me cry😕
View GitHub Profile
@voodoohop
voodoohop / chatgpt_image_generation.txt
Last active December 13, 2023 19:45
Allow ChatGPT to generate images using Stable Diffusion
You will now act as a prompt generator.
I will describe an image to you, and you will create a prompt that could be used for image-generation.
Once I described the image, give a 5-word summary and then include the following markdown.
![Image](https://image.pollinations.ai/prompt/{description})
where {description} is:
{sceneDetailed}%20{adjective}%20{charactersDetailed}%20{visualStyle}%20{genre}%20{artistReference}
Make sure the prompts in the URL are encoded. Don't quote the generated markdown or put any code box around it.
@dogles
dogles / markovjr_tech_notes.md
Last active March 25, 2024 15:57
Markov Jr. Technical Notes

Introduction

Markov Jr. is an open source C# application that creates procedural content primarily via applying Markov rewrite rules to a 2D or 3D grid. A rewrite rule has an input and output pattern, which essentially specifies what pattern to look for in the existing grid, and what to replace it with.

For example, given a 2D grid, this would replace any white dot with a white cross:

***/*W*/*** :: *W*/WWW/*W*

The left hand side is the rule input, and the right hand side is the output. The / character is used to delimit rows, and space is used to delimit Z-layers (in 3D grids). The input rule above translates to the 2D pattern:

@ryanschmidtEpic
ryanschmidtEpic / subtract_actors.py
Created March 1, 2022 22:38
Sample UnrealEngine 5.0 Python Script for using Geometry Scripting to do a Boolean Subtract operation
#
# Unreal Engine 5.0 Python Script that takes in N >= 2 selected StaticMesh Actors,
# and subtracts Actors 1..N from the first Actor
#
import unreal
# output path and asset name (random suffix will be appended)
BooleanResultBasePath = "/Game/PythonBooleanTest"
BooleanResultBaseName = "PyBoolean"
@ufna
ufna / clouds.hlsl
Last active July 22, 2022 03:30
Clouds by iq adoptation for Unreal Engine 4
float3 sundir = normalize( float3(-1.0,0.0,-1.0) );
struct Functions
{
float noise( in float3 x )
{
float3 p = floor(x);
float3 f = frac(x);
f = f*f*(3.0-2.0*f);
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 10, 2024 15:48
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@icpz
icpz / v2ray-as-ss-over-v2plugin-server-config.json
Last active February 15, 2023 16:50
`shadowsocks over v2ray-plugin' as client work with `v2ray' as server
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "info"
},
"inbounds": [
{
"port": "10000", /* this is the server port for client */
"listen": "127.0.0.1",
@tanaikech
tanaikech / submit.md
Last active March 20, 2024 04:21
Upload Files to Google Drive using Javascript

Upload Files to Google Drive using Javascript

News

At October 11, 2019, I published a Javascript library to to run the resumable upload for Google Drive. When this is used, the large file can be uploaded. You can also use this js library.

Description

This is a sample script for uploading files to Google Drive using Javascript. The files are uploaded by Drive API v3. gapi.client.drive.files.create() can create an empty file on Google Drive. But it cannot directly upload files including contents. I think that this might not be able to upload files and metadata with the multipart/related, although this might be resolved by the future update. So now, as one of workarounds, I use using XMLHttpRequest.

  • This sample uses gapi.
  • Before you use this, please enable Drive API at API console and carr
@CristalT
CristalT / FileUploader.vue
Last active October 5, 2023 11:20
File Uploader Component for Vue.js using Firebase Storage
<template>
<div>
<input type="file" multiple accept="image/jpeg" @change="detectFiles($event.target.files)">
<div class="progress-bar" :style="{ width: progressUpload + '%'}">{{ progressUpload }}%</div>
</div>
</template>
<script>
@eugenebrusov
eugenebrusov / 1_item_avatar_media16x9_supportingtext_actions.xml
Last active February 2, 2019 02:12
CardView - avatar, media 16:9, supporting text and action buttons
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/CardView.Light"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp">
<android.support.constraint.ConstraintLayout
@clyang
clyang / gist:4f3e9f4098469cf53715ed64bede3932
Last active January 28, 2024 23:54
10GB以上的測速檔案 (IPv4及IPv6) - 10GB+ Speedtest file urls (IPv4 & IPv6)
http://download.xs4all.nl/test/10GB.bin
http://ftp.iinet.net.au/test500MB.dat
http://lg-tor.fdcservers.net/10GBtest.zip
http://lg.ams2-c.fdcservers.net/10GBtest.zip
http://lg.chi2-c.fdcservers.net/10GBtest.zip
http://lg.den2-c.fdcservers.net/10GBtest.zip
http://lg.fra2-c.fdcservers.net/10GBtest.zip
http://lg.la2-c.fdcservers.net/10GBtest.zip
http://lg.lon-c.fdcservers.net/10GBtest.zip
http://lg.mad-c.fdcservers.net/10GBtest.zip