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
| #!/usr/bin/env bash | |
| # Set up this OpenClaw VPS so a bridge operator can register it via | |
| # POST /api/instances. Designed to be run as: | |
| # | |
| # curl -fsSL <hosted-url>/install-target.sh | sudo bash | |
| # | |
| # Non-interactive use: | |
| # | |
| # sudo TS_AUTHKEY=tskey-auth-... TS_HOSTNAME=openclaw-acme bash install-target.sh | |
| # |
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
| My name is Yakir Perlin | |
| Proxies are intermediary servers that stand between a client and other servers. Proxies can be used to make requests, and hide the details of requests made. When making a request for you, proxies don’t give out your IP address. |
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
| const axios = require('axios'); | |
| exports.handler = async function(event, context, callback) { | |
| const apicall = await axios.post('https://api.openai.com/v1/images/generations', | |
| { | |
| "prompt": event.requestContext.http.path.split('/').join(''), | |
| "n": 1, | |
| "size": "1024x1024" | |
| }, |
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 async from 'async' | |
| import cloudinary from "cloudinary"; | |
| cloudinary.config({ | |
| cloud_name: '', | |
| api_key: '', | |
| api_secret: '', | |
| secure: true | |
| }); |
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
| const functions = require('firebase-functions'); | |
| var ChessImageGenerator = require('chess-image-generator'); | |
| const express = require('express'); | |
| var bodyParser = require('body-parser') | |
| var decode = require('urldecode') | |
| const app = express(); | |
| app.use(bodyParser.json()); | |
| app.use(bodyParser.urlencoded({ | |
| extended: true |
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
| const cloudinary = require('cloudinary'); | |
| const async = require("async"); | |
| var uuid = require('uuid-v4'); | |
| cloudinary.config({ | |
| cloud_name: "<cloud_name>", | |
| api_key: "<api_key>", | |
| api_secret: "<api_secret>" | |
| }); |
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
| async function tapCheckbox(checkboxesToTap){ | |
| for (var i = 0; i < checkbokToTap.length; i++) { | |
| switch (checkbokToTap[i]) { | |
| case '0': | |
| await DetoxHelper.scrollToVisibleElement(element((by.id(testIDs.INVITES.CREATION_APPS_ELEMENT + '_0.checkbox'))); | |
| await element((by.id(testIDs.INVITES.CREATION_APPS_ELEMENT + '_0.checkbox')).tap(); |
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
| //Object | |
| class Book { | |
| constructor(name,author,is_read) { | |
| this.name = name; | |
| this.author = author; | |
| this.is_read = is_read; | |
| } |
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
| <a href="#" id="upload_widget_opener">Upload multiple images</a> | |
| <script src="https://widget.cloudinary.com/global/all.js" type="text/javascript"></script> | |
| <script type="text/javascript"> | |
| document.getElementById("upload_widget_opener").addEventListener("click", function() { | |
| cloudinary.openUploadWidget({ cloud_name: 'cloud_name', upload_preset: 'upload_preset'}, | |
| function(error, result) { | |
| console.log(error, result) | |
| }); |
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
| /** | |
| * This method converts dp unit to equivalent pixels, depending on device density. | |
| * | |
| * @param dp A value in dp (density independent pixels) unit. Which we need to convert into pixels | |
| * @param context Context to get resources and device specific display metrics | |
| * @return A float value to represent px equivalent to dp depending on device density | |
| */ | |
| public static float convertDpToPixel(float dp, Context context){ | |
| Resources resources = context.getResources(); | |
| DisplayMetrics metrics = resources.getDisplayMetrics(); |
NewerOlder