Skip to content

Instantly share code, notes, and snippets.

@c80609a
c80609a / workflow_ssd1b.json
Created December 25, 2024 08:06 — forked from 4rmx/workflow_ssd1b.json
ComfyUI Workflow for test SSD-1B model
{
"last_node_id": 152,
"last_link_id": 387,
"nodes": [
{
"id": 11,
"type": "VAEDecode",
"pos": [
4250,
-150
@c80609a
c80609a / chat_gpt_prompt.md
Created December 23, 2024 00:52
chat_gpt_prompt.md
[SUBJECT]=Topic or skill to learn
[CURRENT_LEVEL]=Starting knowledge level (beginner/intermediate/advanced)
[TIME_AVAILABLE]=Weekly hours available for learning
[LEARNING_STYLE]=Preferred learning method (visual/auditory/hands-on/reading)
[GOAL]=Specific learning objective or target skill level

Step 1: Knowledge Assessment
1. Break down [SUBJECT] into core components
2. Evaluate complexity levels of each component
@c80609a
c80609a / Runpod_SD_download.sh
Created December 22, 2024 16:08 — forked from TheCraigFergus/Runpod_SD_download.sh
Runpod_SD_download
## Download SD's models, loras, textual inversions to Runpod's machine
# Checkpoints
cd /workspace/stable-diffusion-webui/models/Stable-diffusion
wget -O AbsoluteReality.safetensors https://civitai.com/api/download/models/132760?type=Model&format=SafeTensor&size=pruned&fp=fp16
wget -O RealisticVision-v51.safetensors https://civitai.com/api/download/models/130072?type=Model&format=SafeTensor&size=full&fp=fp16
wget -O CyberRealistic.safetensors https://civitai.com/api/download/models/114429?type=Model&format=SafeTensor&size=pruned&fp=fp32
wget -O EpicRealism.safetensors https://civitai.com/api/download/models/127742?type=Model&format=SafeTensor&size=pruned&fp=fp16
wget -O MajicMIX.safetensors https://civitai.com/api/download/models/94640?type=Model&format=SafeTensor&size=pruned&fp=fp16
wget -O URPM.safetensors https://civitai.com/api/download/models/15640?type=Model&format=SafeTensor&size=full&fp=fp16
@c80609a
c80609a / date-timezones-by-offset
Created December 19, 2024 08:40 — forked from gerardroche/date-timezones-by-offset
Timezones by offset
name: Pacific/Kiritimati , cc: KI , offset: 50400 (14 hours) , comments: Line Islands
name: Pacific/Chatham , cc: NZ , offset: 49500 (13.75 hours) , comments: Chatham Islands
name: Pacific/Fakaofo , cc: TK , offset: 46800 (13 hours) , comments:
name: Antarctica/South_Pole , cc: AQ , offset: 46800 (13 hours) , comments: Amundsen-Scott Station, South Pole
name: Antarctica/McMurdo , cc: AQ , offset: 46800 (13 hours) , comments: McMurdo Station, Ross Island
name: Pacific/Tongatapu , cc: TO , offset: 46800 (13 hours) , comments:
name: Pacific/Enderbury , cc: KI , offset: 46800 (13 hours) , comments: Phoenix Islands
name: Pacific/Apia , cc: WS , offset: 46800 (13 hours) , comments:
@c80609a
c80609a / code.md
Created December 14, 2024 00:58
Python: get width and height of mp4

To convert the provided Java code to Python, you need to handle the differences in syntax, libraries, and how input/output operations are performed. Here’s a step-by-step conversion of the given Java code:

Java to Python Conversion

Importing Necessary Modules

In Python, you need to import the necessary modules. For this example, you will need sys for command line arguments and no specific module for file input/output since Python's built-in open function can handle it.

Main Class and Methods

Here is the converted code:

To illustrate the Proxy pattern in Ruby using the Flickr API, you can create a proxy that controls access to the Flickr API, such as managing authentication, caching, or limiting the number of API calls. Here’s an example of a FlickrProxy that acts as a surrogate for accessing the Flickr API, incorporating some of the features mentioned in the sources:

Example: Protective Proxy for Flickr API Access

This example uses the flickr gem to interact with the Flickr API and implements a proxy to manage authentication and API calls.

Step 1: Set Up the Flickr Gem

First, ensure you have the flickr gem installed and configured with your API credentials.

@c80609a
c80609a / 2. Ракурсы.txt
Last active December 21, 2024 13:47
AI: Image Prompts And Tips
1. full body shot — полный рост
2. scenic full shot — панорамный общий план
3. wide shot — широкий план
4. bottom view, low angle — вид снизу, низкий угол
5. very long shot, Dutch angle scene — очень длинный план, наклонный ракурс
6. Aerial View — вид с воздуха
7. Bird's Eye View — вид с высоты птичьего полета
8. Camera View From Above — вид камеры сверху
9. Canted Angle (Dutch Tilt) — наклонный угол (дутый наклон)
10. Cinematic Panorama — кинематографическая панорама
@c80609a
c80609a / answer.md
Created December 7, 2024 09:52
How can a Google Play app developer detect the currency code used in the app user's country?

To determine the currency code used in an app user's country on Google Play, you can follow these steps and utilize the relevant features provided by Google Play:

Using Google Play Console

When you set up your app's prices, Google Play automatically handles the currency conversion based on the user's location. Here’s how you can manage and observe this:

  • Go to the Play Console and navigate to the Monetize with Play > Products > App pricing page. Here, you can review the prices of your app and in-app products in different currencies[2].

Currency Determination

Google Play determines the currency based on the user's location, which is typically derived from their Google Play account settings or their billing address. When a user makes a purchase, the currency used is the one associated with their location, and Google converts the amount to the currency of your payments profile if necessary[2].

Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
class BinaryNode:
__slots__ = ("value", "left", "right")
def __init__(self, value=None, left=None, right=None):
self.value = value
self.left = left
self.right = right
def __repr__(self):
return f"<BinaryNode value={self.value}; {1 if self.left else 0 + 1 if self.right else 0} children>"