Skip to content

Instantly share code, notes, and snippets.

View jacobwindsor's full-sized avatar
🏠
Working from home

Jacob Windsor jacobwindsor

🏠
Working from home
View GitHub Profile
@jacobwindsor
jacobwindsor / hubspot-api-example.js
Last active February 6, 2024 14:44
Example of using HubSpot API to publish forms without using non-hubspot forms
// See https://legacydocs.hubspot.com/docs/methods/forms/submit_form
// See https://legacydocs.hubspot.com/docs/methods/get-account-details?hsLang=en
const PORTAL_ID = 123456;
// See https://knowledge.hubspot.com/forms/find-your-form-guid?_ga=2.268783985.1076297500.1664283830-1987132661.1663058677
const FORM_ID = "this-is-a-guid";
// This is the marketing subscription for GDPR stuff
// You can find this by calling https://api.hubapi.com/email/public/v1/subscriptions?hapikey=your-api-key
// And cross referencing against the subscriptions listed in HubSpot > settings > marketing > email > subscription types
const MARKETING_SUBSCRIPTION_ID = "123456"
import argparse, json, requests
def get_publications_journal(publications):
# Use crossref API to get extra meta info
# This should be replicated in ingest API endpoint when we have an endpoint
# Not done on client side for speed
results = []
for publication in publications:
try:
# Add the below to your .bashrc
# if [ -f ~/.bash_aliases ]; then
# . ~/.bash_aliases
# fi
# List
alias ls="ls --color=auto"
alias ll="ls -al"
alias l.="ls -d .* --color=auto"
@jacobwindsor
jacobwindsor / main.config.js
Last active November 22, 2018 13:56
Webpack configs for Webpack issue 8690
const CleanWebpackPlugin = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const DependencyManifest = require('./plugins/DependencyManifest');
const AddModernizrPlugin = require('./plugins/AddModernizr');
const webpack = require('webpack');
const path = require('path');
const settings = require('./settings');
const utils = require('./utils');
/**
@jacobwindsor
jacobwindsor / advanced.html
Last active July 31, 2017 15:17
Pvjs Custom Element Advanced Example
<!DOCTYPE html>
<html lang="en">
<head>
<!--This is needed for everyting to behave-->
<meta charset="utf-8">
<title>Advanced Pvjs</title>
<script src="https://unpkg.com/@wikipathways/pvjs/dist/index.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@wikipathways/pvjs/dist/style.css" />
@jacobwindsor
jacobwindsor / basic.html
Last active May 4, 2023 19:35
Pvjs Custom Element Basic Example
<!DOCTYPE html>
<html lang="en">
<head>
<!--This is needed for everyting to behave-->
<meta charset="utf-8">
<title>Basic Pvjs</title>
<script src="https://unpkg.com/@wikipathways/pvjs/dist/index.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@wikipathways/pvjs/dist/style.css" />
<html>
<head>
<!--Import Polymer polyfill-->
<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>
<!--Import the custom element-->
<link rel="import" href="bower_components/wikipathways-pvjs/pvjs.html">
<!--Instead of the above, we could wrap the polyfill and web component into a bundle-->
<!--In the Polymer docs the above method is used everywhere but we would also support React too so maybe this method is more appropriate-->
<script src="http://wikipathways.org/wpi/lib/pvjs/release/versionNumber/webcomponent.js"></script>