This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Stable Diffusion is an AI art generation model similar to DALLE-2. | |
Here are some prompts for generating art with Stable Diffusion. | |
Example: | |
- A ghostly apparition drifting through a haunted mansion's grand ballroom, illuminated by flickering candlelight. Eerie, ethereal, moody lighting. | |
- portait of a homer simpson archer shooting arrow at forest monster, front game card, drark, marvel comics, dark, smooth | |
- pirate, deep focus, fantasy, matte, sharp focus | |
- red dead redemption 2, cinematic view, epic sky, detailed, low angle, high detail, warm lighting, volumetric, godrays, vivid, beautiful | |
- a fantasy style portrait painting of rachel lane / alison brie hybrid in the style of francois boucher oil painting, rpg portrait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun <R> retry( | |
maxAttempts: Int, | |
action: () -> R | |
): R { | |
require(maxAttempts > 0) { "maxAttempts must be greater than 0" } | |
return runCatching(action).getOrElse { | |
val leftAttempts = maxAttempts.dec() | |
if (leftAttempts == 0) throw it | |
retry(leftAttempts, action) | |
} |
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'
instead ofconst foo = require('foo')
to import the package. You also need to put"type": "module"
in your package.json and more. Follow the below guide. - If the package is used in an async context, you could use
await import(…)
from CommonJS instead ofrequire(…)
. - Stay on the existing version of the package until you can move to ESM.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
from boto3 import Session as AWSSession | |
from requests_aws4auth import AWS4Auth | |
from gql import gql | |
from gql.client import Client | |
from gql.transport.requests import RequestsHTTPTransport |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First let's update all the packages to the latest ones with the following command | |
sudo apt update -qq | |
# Now we want to install some prerequisite packages which will let us use HTTPS over apt | |
sudo apt install apt-transport-https ca-certificates curl software-properties-common -qq | |
# After that we will add the GPG key for the official Docker repository to the system | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
# We will add the Docker repository to our APT sources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function memorySizeOf(obj) { | |
var bytes = 0; | |
function sizeOf(obj) { | |
if (obj !== null && obj !== undefined) { | |
switch (typeof obj) { | |
case "number": | |
bytes += 8; | |
break; | |
case "string": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python3 | |
# download all PlaysTv videos of a user | |
# To find the user id, navigate to the your profile while logged in (IMPORTANT!) | |
# View source of the page, In the <html> tag there's data-conf attribute. | |
# The json in there will have the user id under [login_user.id] | |
user_id = "<playstv user guid>" | |
# Replace the <playstv user guid> above with your ID |
- Run
npm install cordova-res --save-dev
- Create
1024x1024px
icon atresources/icon.png
- Create
2732x2732px
splash atresources/splash.png
- Add
"resources": "cordova-res ios && cordova-res android && node scripts/resources.js"
toscripts
inpackage.json
- Copy
resources.js
file toscripts/resources.js
- Run
sudo chmod -R 777 scripts/resources.js
- Run
npm run resources
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
You need to call the below method once. It register the callback and fire it when there is a change in network state. | |
Here I used a Global Static Variable, So I can use it to access the network state in anyware of the application. | |
*/ | |
// You need to pass the context when creating the class | |
public CheckNetwork(Context context) { | |
this.context = context; | |
} |
NewerOlder