- "sand sculpture" https://www.reddit.com/r/dalle2/comments/wg8c7a/cthulu_intricate_sand_sculpture_high_detail_uhd/
- "detailed infographic of a" https://www.reddit.com/gallery/wgmd2q
- "Vintage, grainy, sepia, photograph of adorned Native American man, Hassleblad, f4, 150mm, natural light" https://www.reddit.com/gallery/wgpl67
- “iphone made of terracotta from Harappa, Indus Valley Civilization, Pakistan; 2600-1900 BC, studio light” https://labs.openai.com/s/Txu20Vvd5hZ2KyMiwN6BMbUk
- "Colorful surreal seamless pattern of" https://www.reddit.com/r/dalle2/comments/wgrqvf/dalle_is_good_at_generating_seamless_patterns/
- Add phrases like “A film still from ___ movie”, and insert a visually stunning movie
- "behind frosted glass" https://www.reddit.com/r/dalle2/comments/wl45px/wendigo_laughing_behind_frosted_glass/
- “elaborate drop cap art of the capital letter D integrated in a seamless doodle art, organic, decorative, black and white, in the style o
This file contains hidden or 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 warnings | |
from skimage.measure import compare_ssim | |
from skimage.transform import resize | |
from scipy.stats import wasserstein_distance | |
from scipy.misc import imsave | |
from scipy.ndimage import imread | |
import numpy as np | |
import cv2 | |
## |
My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
This file contains hidden or 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
<?php | |
// Lets say , we want to send a direction request with guidance to Google Maps API using link below. | |
// https://maps.googleapis.com/maps/api/directions/json?origin=-6.190109,%20106.798565&destination=-6.177596,%20106.792611&key=USEYOUR_KEY | |
// some of request, especially in field html-instruction would return unicode html text like this one ('Head \u003cb\u003ewest\u003c/b\u003e'). | |
// for some reason, I just want to use the text provided there ('Head west'). | |
// after some googling and asking, here is the best code I have (right now) | |
# example response | |
//Type A : There are 2 sentence in one single direction response |
This file contains hidden or 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
package demo.plain; | |
import org.keycloak.OAuth2Constants; | |
import org.keycloak.admin.client.CreatedResponseUtil; | |
import org.keycloak.admin.client.Keycloak; | |
import org.keycloak.admin.client.KeycloakBuilder; | |
import org.keycloak.admin.client.resource.RealmResource; | |
import org.keycloak.admin.client.resource.UserResource; | |
import org.keycloak.admin.client.resource.UsersResource; | |
import org.keycloak.representations.idm.ClientRepresentation; |
This file contains hidden or 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
'use strict'; | |
const Http = require('http'); | |
const Request = require('request'); | |
const LISTEN_ADDRESS = '127.0.0.1'; | |
const LISTEN_PORT = 9090; | |
const REQUEST_TIMEOUT = 1000; | |
const URL_PREFIX = '/webhook'; | |
const PROXY = ''; |
This file contains hidden or 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
`dropDups: true` option is not available in 3.0. | |
I have solution with aggregation framework for collecting duplicates and then removing in one go. | |
It might be somewhat slower than system level "index" changes. But it is good by considering way you want to remove duplicate documents. | |
a. Remove all documents in one go | |
var duplicates = []; | |
This file contains hidden or 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
""" | |
Read graphs in Open Street Maps osm format | |
Based on osm.py from brianw's osmgeocode | |
http://github.com/brianw/osmgeocode, which is based on osm.py from | |
comes from Graphserver: | |
http://github.com/bmander/graphserver/tree/master and is copyright (c) | |
2007, Brandon Martin-Anderson under the BSD License | |
""" | |
import xml.sax |
This file contains hidden or 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 pyaudio | |
import wave | |
FORMAT = pyaudio.paInt16 | |
CHANNELS = 2 | |
RATE = 44100 | |
CHUNK = 1024 | |
RECORD_SECONDS = 5 | |
WAVE_OUTPUT_FILENAME = "file.wav" | |
Provided that you already have a file or stream segmenter generating your .m3u8 playlist and .ts segment files (such as the ffmpeg 'hls' muxer), this little node server will serve up those files to an HLS compatible client (e.g. Safari). If you're using node for your streaming app already, this obviates the need to serve the HLS stream from a separate web server.
loosely based on https://gist.github.com/bnerd/2011232
// loosely based on https://gist.github.com/bnerd/2011232
// requires node.js >= v0.10.0
// assumes that HLS segmenter filename base is 'out'
// and that the HLS playlist and .ts files are in the current directory
NewerOlder