csrutil disable
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
| <?php | |
| /* | |
| * Plugin Name: ACFSyncFieldGroups | |
| * Plugin URI: https://gist.github.com/hirasso/c48c04def92f839f6264349a1be773b3 | |
| * Description: Allows to sync ACF field groups via WP CLI | |
| * Version: 0.0.1 | |
| * Author: Rasso Hilber | |
| * Author URI: https://rassohilber.com/ | |
| * License: GPL2+ | |
| * License URI: https://www.gnu.org/licenses/gpl-2.0.txt |
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
| [ | |
| { | |
| "name": "Alabama", | |
| "alpha": "AL" | |
| }, | |
| { | |
| "name": "Alaska", | |
| "alpha": "AK" | |
| }, | |
| { |
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 React, {useState} from 'react'; | |
| import { useLocation } from 'react-router-dom'; | |
| import Avatar from '@material-ui/core/Avatar'; | |
| import Button from '@material-ui/core/Button'; | |
| import CssBaseline from '@material-ui/core/CssBaseline'; | |
| import TextField from '@material-ui/core/TextField'; | |
| import Link from '@material-ui/core/Link'; | |
| import Grid from '@material-ui/core/Grid'; | |
| import Box from '@material-ui/core/Box'; | |
| import VpnKeyIcon from '@material-ui/icons/VpnKey'; |
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 React, {useState} from 'react'; | |
| import Avatar from '@material-ui/core/Avatar'; | |
| import Button from '@material-ui/core/Button'; | |
| import CssBaseline from '@material-ui/core/CssBaseline'; | |
| import TextField from '@material-ui/core/TextField'; | |
| import Link from '@material-ui/core/Link'; | |
| import Grid from '@material-ui/core/Grid'; | |
| import Box from '@material-ui/core/Box'; | |
| import LockOutlinedIcon from '@material-ui/icons/LockOutlined'; | |
| import Typography from '@material-ui/core/Typography'; |
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 { Request, Response } from "express"; | |
| import XeroService from '../services/XeroService'; | |
| import LocateServiceFactory from "../services/LocateServiceFactory"; | |
| export default class XeroLocateController { | |
| static createProject = async (req: Request, res: Response) => { | |
| const { name, env } = req.query; | |
| const locateService = await LocateServiceFactory.create(env); | |
| try { |
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 { Request, Response, NextFunction } from "express"; | |
| export const sse = async (req: Request, res: Response, next: NextFunction) => { | |
| if (req.headers.accept && req.headers.accept === 'text/event-stream') { | |
| res.writeHead(200, { | |
| 'Content-Type': 'text/event-stream', | |
| 'Cache-Control': 'no-cache', | |
| 'Connection': 'keep-alive' | |
| }); | |
| res.locals = { |
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 { Request, Response, NextFunction } from "express"; | |
| import * as jwt from "jsonwebtoken"; | |
| import config from "../config/config"; | |
| export const checkJwt = (req: Request, res: Response, next: NextFunction) => { | |
| const token = <string>req.headers["authorization"].match(/^Bearer (.*)$/)[1]; | |
| let jwtPayload; | |
| try { | |
| jwtPayload = <any>jwt.verify(token, config.jwtSecret); |
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 Config from '../config/config'; | |
| import { AccountingAPIClient as XeroClient } from 'xero-node'; | |
| import { XeroClientConfiguration } from 'xero-node/lib/internals/BaseAPIClient'; | |
| export default class XeroService { | |
| static createProject = async (name: string) => { | |
| const { apiConfig, trackingProjectCategoryName } = Config.xero; | |
| try { | |
| let xeroClient = new XeroClient(apiConfig as XeroClientConfiguration); |
NewerOlder