Consider a list of strings you need to permanently assign a random color.
First you should turn the string into a hash.
var string = "string"
var hash = 0| from pprint import PrettyPrinter | |
| import requests | |
| pp = PrettyPrinter() | |
| def query(number) | |
| url = f"https://wwwapi.lcsc.com/v1/products/detail?product_code={number}" | |
| r = requests.get(url) | |
| pp.pprint(r.json()) |
| // ==UserScript== | |
| // @name Extract AliExpress Order Detail Pages | |
| // @downloadURL https://gist.github.com/Bolukan/16146e6e9c3c7e05a8a23f8b2f8a1dc4/raw/778a24f255bb6f91bf07019e94e1eabb333ef17c/Aliexpress_items.user.js | |
| // @updateURL https://gist.github.com/Bolukan/16146e6e9c3c7e05a8a23f8b2f8a1dc4/raw/778a24f255bb6f91bf07019e94e1eabb333ef17c/Aliexpress_items.user.js | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.5 | |
| // @description Extract the contents from AliExpress order detail pages, while also removing all svg tags | |
| // @author You | |
| // @match https://www.aliexpress.com/p/order/detail.html* | |
| // @grant GM_xmlhttpRequest |
| import cv2 | |
| image = cv2.imread('test.jpg') | |
| overlay = image.copy() | |
| x, y, w, h = 10, 10, 10, 10 # Rectangle parameters | |
| cv2.rectangle(overlay, (x, y), (x+w, y+h), (0, 200, 0), -1) # A filled rectangle | |
| alpha = 0.4 # Transparency factor. |
| /** | |
| * Add this to your app's SharedModule declarations | |
| */ | |
| import { Directive, ElementRef, Input } from '@angular/core'; | |
| // nativescript | |
| import { View } from 'tns-core-modules/ui/core/view'; | |
| import { Animation, AnimationDefinition } from 'tns-core-modules/ui/animation'; |
| // | |
| // Simple listener.c program for UDP multicast | |
| // | |
| // Adapted from: | |
| // http://ntrg.cs.tcd.ie/undergrad/4ba2/multicast/antony/example.html | |
| // | |
| // Changes: | |
| // * Compiles for Windows as well as Linux | |
| // * Takes the port and group on the command line | |
| // |
| #!/bin/bash | |
| file=$1 | |
| test -z $file && echo "file required." 1>&2 && exit 1 | |
| git filter-branch -f --index-filter "git rm -r --cached $file --ignore-unmatch" --prune-empty --tag-name-filter cat -- --all | |
| git ignore $file | |
| git add .gitignore | |
| git commit -m "Add $file to .gitignore" |