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
from flask.ext.wtf import Form | |
from flask.ext.wtf.file import FileField | |
import imghdr | |
class ImageFileRequired(object): | |
""" | |
Validates that an uploaded file from a flask_wtf FileField is, in fact an | |
image. Better than checking the file extension, examines the header of |
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
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: |
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
from celery.schedules import crontab | |
from flask.ext.celery import Celery | |
CELERYBEAT_SCHEDULE = { | |
# executes every night at 4:15 | |
'every-night': { | |
'task': 'user.checkaccounts', | |
'schedule': crontab(hour=4, minute=20) | |
} | |
} |
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
#!/bin/bash | |
DO_TOKEN= | |
DO_API=https://api.digitalocean.com/v2 | |
CF_API_KEY= | |
CF_AUTH_EMAIL= | |
CF_ROOT_DOMAIN= | |
CF_RECORD= | |
CF_API=https://api.cloudflare.com/client/v4 |
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 UpdatePersonName(graphene.Mutation): | |
class Input: | |
uuid = graphene.Int(required=True) | |
name = graphene.String(required=True) | |
person = graphene.Field(Person) |
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
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 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
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) |
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
package main | |
import ( | |
"crypto" | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/sha256" | |
"encoding/base64" | |
"testing" | |
) |
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
.leaflet-div-icon { | |
background: transparent; | |
border: none; | |
} | |
.leaflet-marker-icon .number{ | |
position: relative; | |
top: -37px; | |
font-size: 12px; | |
width: 25px; |
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
package main | |
import ( | |
"log" | |
"net/mail" | |
"encoding/base64" | |
"net/smtp" | |
"fmt" | |
"strings" |
OlderNewer