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
imagekit_private_key = '..' | |
base = 'https://api.imagekit.io/v1' | |
# files = {"file": result.content} # example from a url | |
files = {"file": open('/some/file.png', 'rb')} # from a local file | |
data = { | |
"fileName": "my-file.png", | |
"tags": "foo,bar,baz", | |
"folder": "/remote/file/path/" | |
} |
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 PyPDF2 | |
import io | |
from weasyprint import HTML | |
password = 'foo' | |
url = "https://google.com" | |
pdf = HTML(url).write_pdf() | |
in_file = io.BytesIO(pdf) | |
out_file = open('google.pdf', 'wb') |
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
window.matchMedia('(prefers-color-scheme: dark)').matches |
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
class FacetedPagination(pagination.PageNumberPagination): | |
""" | |
If requested, will include facet information in the response | |
Example response | |
``` | |
{ | |
"links": { | |
"next": .., | |
"previous": .., |
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
const puppeteer = require('puppeteer'); | |
const fs = require('fs'); | |
const URL = https://apexcharts.com/" // set this to the url you want to generate a pdf of | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto(URL, {waitUntil: 'networkidle2'}); | |
await page.pdf({path: 'download.pdf', format: 'A4'}); | |
await browser.close(); |
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
<template> | |
<input type=text v-model='value' @kepup='debounceExpensiveMethod' /> | |
</template> | |
<script> | |
export default { | |
name: 'SomeComponent', | |
data () { | |
return { | |
timeout: null | |
} |
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
<template> | |
<v-autocomplete | |
v-model='item' | |
@update:searchInput='valueTyped' | |
:items='computedItems' | |
v-bind='extraProps' > | |
</v-autocomplete> | |
</template> | |
<script> |
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
[bumpversion] | |
current_version = 1.0.0 | |
commit = False | |
tag = False | |
[bumpversion:file:api/custom_settings.py] |
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 requests | |
def send_sms(to, content): | |
token = '..' | |
email = '..' | |
headers = {'Content-type': 'application/json', 'Accept': 'application/json'} | |
params = { | |
token: token, | |
email: email | |
} |
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
version: "3" | |
services: | |
konga: | |
image: pantsel/konga:latest | |
env_file: 'kong.env' | |
ports: | |
- '8999:1337' | |
mongo: | |
image: mongo | |
volumes: |
NewerOlder