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 typing import List | |
import requests | |
API_ROOT = 'http://localhost:8000/api/v1' # This is the default for Airbyte | |
def get_workspaces() -> List[str]: | |
response = requests.post(f'{API_ROOT}/workspaces/list') | |
response.raise_for_status() # Either handle this yourself, or use a tool like Sentry for logging |
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
const puppeteer = require('puppeteer'); | |
class Webpage { | |
static async generatePDF(url) { | |
const browser = await puppeteer.launch({ headless: true }); // Puppeteer can only generate pdf in headless mode. | |
const page = await browser.newPage(); | |
await page.goto(url, { waitUntil: 'networkidle', networkIdleTimeout: 5000 }); // Adjust network idle as required. | |
const pdfConfig = { | |
path: 'url.pdf', // Saves pdf to disk. | |
format: 'A4', |
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
proxy_http_version 1.1; | |
proxy_set_header Connection ""; | |
https://gist.github.com/miguelmota/6912559 | |
# The upstream module is the link between Node.js and Nginx. | |
# Upstream is used for proxying requests to other servers. | |
# All requests for / get distributed between any of the servers listed. | |
upstream helloworld { | |
# Set up multiple Node.js webservers for load balancing. | |
# max_fails refers to number of failed attempts | |
# before server is considered inactive. |
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
@servers([ 'remote' => 'server.example.com', ]) | |
@setup | |
if ( ! isset($repo) ) | |
{ | |
throw new Exception('--repo must be specified'); | |
} | |
if ( ! isset($base_dir) ) | |
{ |
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
#!/usr/bin/env bash | |
# Bash script to back up an easyengine webiste installation | |
# To debug, use set -xe | |
# I personally prefer to create an alias, after I placed this file at ~/scripts/ | |
# echo 'alias eebackup=". ~/scripts/eebackup.sh"' >> ~/.bash_aliases | |
# . ~/.bash_rc to load the new alias | |
# Note that the script will also create a log at the /var/www/backupdomain.com/logs/ folder | |
set -e | |
LOG_FILE="/var/www/$1/logs/eebackup.log" |
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
# Gist example of IB wrapper ... | |
# | |
# Download API from http://interactivebrokers.github.io/# | |
# | |
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install | |
# | |
# Note: The test cases, and the documentation refer to a python package called IBApi, | |
# but the actual package is called ibapi. Go figure. | |
# | |
# Get the latest version of the gateway: |
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
<?php namespace GM\WWWPostThumbnail; | |
/** | |
* Plugin Name: WWW Post Thumbnail | |
* Description: Allow to use an external image url as featured image. | |
* Plugin URI: https://gist.github.com/Giuseppe-Mazzapica/928bc22e5f49a654cf7c | |
* Author: Giuseppe Mazzapica | |
* Author URI: https://github.com/Giuseppe-Mazzapica | |
* License: MIT | |
* Version: 0.1.0 | |
* |
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
//updated Jan 12 2013 | |
//check out Geb/Phantomjs integration via RemoteWebDriver support! | |
@Grapes([ | |
@Grab("junit:junit-dep:4.8.2"), | |
@Grab("org.codehaus.geb:geb-junit4:0.7.2"), //soon to go 0.9.0 | |
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.28.0"), | |
@Grab("org.seleniumhq.selenium:selenium-remote-driver:2.28.0"), | |
@Grab("org.seleniumhq.selenium:selenium-support:2.28.0") | |
]) |
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
<? | |
/** | |
* Sessions DB Table Task | |
* | |
* Run this task to set add/remove/clear the db sessions table | |
* for your app. This could be expanded in app/tasks for application specific stuff. | |
* | |
* @version 1.0 | |
* @author Daniel Berry | |
* @license MIT License |