Skip to content

Instantly share code, notes, and snippets.

{
"⤡": "⤡",
"⊞": "⊞",
"×": "×",
"❮": "❮",
"❯": "❯",
"Loading...": "加载中...",
"Waiting...": "等待中...",
"In queue...": "队列中...",
"@@/^Waiting (.*)$/": "等待中 $1",
@voodoohop
voodoohop / chatgpt_image_generation.txt
Last active September 5, 2024 22:50
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.
package sitemap
import (
"encoding/xml"
"jobs"
"net/http"
"time"
"github.com/gin-gonic/gin"
)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/[email protected]/token/ERC721/ERC721.sol";
import "@openzeppelin/[email protected]/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/[email protected]/access/Ownable.sol";
contract MyToken is ERC721, ERC721Enumerable, Ownable {
@KaneBuckthorpe
KaneBuckthorpe / TagItem.swift
Last active October 18, 2022 07:15
SwiftUI - WrappedHStack + example TagsView
//
// TagItem.swift
// ChalkUp
//
// Created by kane buckthorpe on 13/03/2021.
//
import Foundation
class TagItem: ObservableObject {
@dahlsailrunner
dahlsailrunner / SSL-nginx-Docker.md
Last active October 23, 2024 09:30
SSL with Docker images using nginx as reverse proxy

Docker with SSL and an nginx reverse proxy

Running your ASP.NET Core (or other) application in Docker using SSL should not be an overwhelming task. These steps should do the trick.

Run the following steps from a Linux terminal (I used WSL or WSL2 on Windows from the Windows Terminal).

1. Create a conf file with information about the cert you'll be creating

It should look something like the content below; call it my-site.conf or something like that.

import SwiftUI
struct WrappingStack<T: View>: UIViewRepresentable {
@Binding var views: [T]
let spacing: CGFloat
func makeUIView(context: Context) -> WrappingStackView {
let view = WrappingStackView()
view.spacing = spacing
return view
@mayneyao
mayneyao / notion2blog.js
Last active September 14, 2024 01:22
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@antlis
antlis / ga-html5boilerplate.pug
Last active August 21, 2019 03:39
Google analytics pug mixin, HTML5 boilerplate like
mixin ga(id)
//- Pass your ga id, as attribute, eg. +ga('yourid12345')
script.
window.ga = function () { ga.q.push(arguments) }; ga.q = []; ga.l = +new Date;
ga('create', '!{id}', 'auto'); ga('set','transport','beacon'); ga('send', 'pageview')
script(src='https://www.google-analytics.com/analytics.js')
@garrettmurray
garrettmurray / Example.swift
Last active February 1, 2024 01:44
An example solution for .onDelete issues with nested sections of data in SwiftUI. Thanks to @mayoff for help!
import SwiftUI
func bind<Value, Answer>(_ value: Value, to answer: (Value) -> Answer) -> Answer { answer(value) }
struct Example: View {
struct SomeGroup: Identifiable, RandomAccessCollection {
typealias Indices = CountableRange<Int>
public typealias Index = Int;
var id: Int