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
# To connect this middleware.rb file to your sinatra app | |
# add 'use JWTAuthorization' as one of your first lines in | |
# your Application class. | |
# e.g. | |
# require 'middlewares.rb' | |
# class Application < Sinatra::Base | |
# use JWTAuthorization | |
# ... | |
# end |
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
# pip install pyautogui | |
# pip install pyobjc-core | |
# pip install pyobjc | |
# python3 software_update.py | |
# Opens baby shark And mouse will freak out. | |
import time | |
import random | |
import pyautogui | |
import webbrowser |
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
// JWT authentication middleware example. | |
// Uses RS256 strategy with .pem key pair files. | |
const fs = require('fs'); | |
const jwt = require('jsonwebtoken'); | |
module.exports = (req, res, next) => { | |
let publicKey = process.env.PUBLIC_KEY; |
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
// User sign-in route with JWT RSA algorithm example | |
var User = require('../models/user') | |
var express = require('express'); | |
var router = express.Router(); | |
const mongoose = require('mongoose'); | |
const bcrypt = require('bcrypt'); | |
const jwt = require('jsonwebtoken'); | |
const fs = require('fs'); | |
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
PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\ndasdasdadasdasdasdasdasdasdasdadasdasdadasa\nhuehuauhhuauhahuauhauahuauhehuehuauheuhahue\n-----END RSA PRIVATE KEY-----\n" | |
PUBLIC_KEY="-----BEGIN RSA PUBLIC KEY-----\nminemineminemineminemineminemineminemineminemine\nhuehuauhhuauhahuauhauahuauhehuehuauheuhahue\n-----END RSA PUBLIC KEY-----\n" |
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-app> | |
<left-menu/> | |
<header-component/> | |
<v-content> | |
<router-view/> | |
</v-content> | |
<footer-component/> | |
</v-app> | |
</template> |
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-app> | |
<left-menu/> | |
<header-component/> | |
<v-content> | |
<router-view/> | |
</v-content> | |
<footer-component/> | |
</v-app> | |
</template> |
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 django.db import models | |
class Something(models.Model): | |
name = models.CharField(max_length=200) | |
@staticmethod | |
def find_by_name(name): | |
try: | |
something = Something.objects.get(name=name) |
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
name: LaravuePostgisCIExample | |
on: | |
push: | |
branches: | |
- master | |
- stage | |
pull_request: | |
branches: | |
- stage |
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 python:3.7.3-stretch | |
ENV PYTHONUNBUFFERED 1 | |
RUN mkdir /code | |
WORKDIR /code | |
COPY requirements.txt /code/ | |
RUN pip install -r requirements.txt | |
COPY . /code/ | |
EXPOSE 3000 |
NewerOlder