Skip to content

Instantly share code, notes, and snippets.

View freelancing-solutions's full-sized avatar
💯
Available

mobius-crypt freelancing-solutions

💯
Available
View GitHub Profile
@freelancing-solutions
freelancing-solutions / python_over_ssh
Created January 16, 2018 10:36 — forked from mattyjones/python_over_ssh
Execute a script located on a remote server over ssh using python
#! /usr/bin/env python
import secure
import pexpect
# the file containing the list of servers to log into
input_file = "script_list"
# The login creds
user = secure.USER
from flask import (render_template, Blueprint, request, abort, make_response, jsonify,redirect, url_for, flash , get_flashed_messages)
from flask_login import login_user,logout_user,login_required
from ..library import Metatags, encode_auth_token, token_required, logged_user
from .models import UserModel
from .. import db
import uuid
from werkzeug.security import check_password_hash, generate_password_hash
users = Blueprint('users', __name__)
from flask import (render_template, Blueprint, request, abort, make_response, jsonify,redirect, url_for, flash , get_flashed_messages)
from flask_login import login_user,logout_user,login_required
from ..library import Metatags, encode_auth_token, token_required, logged_user
from .models import UserModel
from .. import db
import uuid
from werkzeug.security import check_password_hash, generate_password_hash
users = Blueprint('users', __name__)
@freelancing-solutions
freelancing-solutions / metatags.py
Created March 9, 2021 16:47
Custom Metatags handler for a Flask based Website
from flask import url_for
class Metatags():
"""
Default Application Meta Tags
"""
title = ""
description = ""
twitter_title = ""
twitter_description = ""
og_title = ""
@freelancing-solutions
freelancing-solutions / sw.js
Last active March 9, 2021 17:58
writing a custom service worker
// Incrementing OFFLINE_VERSION will kick off the install event and force
// previously cached resources to be updated from the network.
const OFFLINE_VERSION = 1;
const CACHE_NAME = 'FREELANCE-PROFILESS';
const website_base_url = 'http://localhost';
// Customize this with your URL.
// TODO- use Flask Assets to bundle some of the adminLTE css files and js files togather,
// TODO- also bundle adminLTE Files with flask bundler...
Pocket Money Wallet Pty LTD
const nodemailer = require('nodemailer');
const Mailgen = require('mailgen');
const config = require("config");
/**
*
* Used to send messages such as
* Login Codes, Email Verification Codes , Transaction Activation Codes, such as Withdrawals
**/
const mailGenerator = new Mailgen({
@freelancing-solutions
freelancing-solutions / test_freelance_job_model.py
Created March 9, 2021 18:34
Test Cases for FlaskAlchemy Models based on PyTest
# import unittest
import uuid, time
from .. import db, create_app
from flask import current_app
from ..library import config
def test_hireme_freelance_job_model():
from ..hireme.models import FreelanceJobModel
from ..users.models import UserModel
if not current_app:
@freelancing-solutions
freelancing-solutions / apikeyauthorizationmiddleware.js
Last active March 9, 2021 23:58
API Key based auth middle ware for node.js and express API
const express = require("express");
const bodyParser = require("body-parser");
const cors = require("cors");
const config = require("config");
const routes = require('./routes');
const PORT = process.env.PORT || 3030;
@freelancing-solutions
freelancing-solutions / React Admin Login Component.js
Created March 10, 2021 00:07
An Email Password Based React Admin Component for Login
import * as React from 'react';
import { useState } from 'react';
import { useLogin, useNotify, Notification, defaultTheme } from 'react-admin';
import { ThemeProvider } from '@material-ui/styles';
import { createMuiTheme } from '@material-ui/core/styles';
const MyLoginPage = ({ theme }) => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const login = useLogin();