This gist is now deprecated in favor of our official documentation: https://documentation.portainer.io/api/api-examples/ which contains up to date examples!
Please refer to the link above to get access to our updated API documentation and examples.
version: "3.7" | |
services: | |
traefik: | |
image: "traefik:v2.2" | |
container_name: "traefik" | |
ports: | |
- "80:80" | |
- "443:443" | |
- "8080:8080" |
package main | |
import ( | |
"crypto" | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/sha256" | |
"encoding/base64" | |
"testing" | |
) |
image: openjdk:8-jdk | |
# image: jangrewe/gitlab-ci-android | |
variables: | |
ANDROID_COMPILE_SDK: "23" | |
ANDROID_BUILD_TOOLS: "23.0.1" | |
ANDROID_SDK_TOOLS: "3859397" | |
before_script: |
// ES6 syntax is used. | |
/* Key: Python format | |
* Value: Javascript format | |
*/ | |
const pyToJSDateFormats = Object.freeze({ | |
'%A': 'dddd', //Weekday as locale’s full name: (In English: Sunday, .., Saturday)(Auf Deutsch: Sonntag, .., Samstag) | |
'%a': 'ddd', //Weekday abbreivated: (In English: Sun, .., Sat)(Auf Deutsch: So, .., Sa) | |
'%B': 'MMMM', //Month name: (In English: January, .., December)(Auf Deutsch: Januar, .., Dezember) | |
'%b': 'MMM', //Month name abbreviated: (In English: Jan, .., Dec)(Auf Deutsch: Jan, .., Dez) |
When building an adnroid app, you might stumble upon this error: | |
`Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE...`. Here's how to fix it: | |
That's because the app you're trying to test was already installed on the device and the signatures are different now, so it's complaining. The full error will look like something like this: | |
`Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.example signatures do not match the previously installed version; ignoring!` | |
You can see that the package ID is `com.example`, well, simply run this command: |
This gist is now deprecated in favor of our official documentation: https://documentation.portainer.io/api/api-examples/ which contains up to date examples!
Please refer to the link above to get access to our updated API documentation and examples.
RECAPTCHA_PUBLIC_KEY = '<public key>' | |
RECAPTCHA_PRIVATE_KEY = '<private key>' | |
def checkRecaptcha(response, secretkey): | |
url = 'https://www.google.com/recaptcha/api/siteverify?' | |
url = url + 'secret=' + str(secretkey) | |
url = url + '&response=' +str(response) |
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |
... | |
class UpdatePersonName(graphene.Mutation): | |
class Input: | |
uuid = graphene.Int(required=True) | |
name = graphene.String(required=True) | |
person = graphene.Field(Person) |
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"io" | |
"net" | |
"net/http" | |
"os" |