Skip to content

Instantly share code, notes, and snippets.

Avatar
:bowtie:
Focusing

David Boland debpu06

:bowtie:
Focusing
View GitHub Profile
View State_question.py
# Starting point
class State:
def __init__(self, name, pop,s_intercept=0,d_intercept=100):
self.name = name
self.population = pop
#supply function parameters
self.supply_intercept=s_intercept
self.supply_slope=1
@debpu06
debpu06 / pdf_save.py
Last active September 17, 2023 22:05
View pdf_save.py
pp = PdfPages(outputfolder + 'my_pdf_name.pdf') # create a new instance of PdfPages specifying the file location
figs = [fig1, fig2, fig3] # all of the figures to add to the file in a list
for fig in figs: # loop through each figure
fig.savefig(pp, format='pdf') # save that figure to the file, specifying pdf format
pp.close() # close the file
@debpu06
debpu06 / post-schema.js
Created August 3, 2023 14:38
Example of adding schema markup to blog post.
View post-schema.js
import { SITE_OWNER_GITHUB, SITE_OWNER_LINKEDIN, SITE_OWNER_TWITTER, SITE_OWNER, SITE_URL } from '../../lib/constants'
export default function PostSchema({ post }) {
const url = post.canonicalUrl !== undefined && post.canonicalUrl !== null ? post.canonicalUrl : `${SITE_URL}/blog/${post.slug}`;
return (
<script
defer
type="application/ld+json"
@debpu06
debpu06 / richtext.js
Created October 18, 2021 18:44
Rich Text Block Contentful & Gatsby
View richtext.js
import React from 'react'
import { BLOCKS, MARKS } from '@contentful/rich-text-types';
import { documentToReactComponents } from '@contentful/rich-text-react-renderer';
import { GatsbyImage, getImage } from "gatsby-plugin-image"
const Bold = ({ children }) => <b>{children}</b>;
const Text = ({ children }) => <p className="align-center">{children}</p>;
const richTextImages = {};
@debpu06
debpu06 / TextBlockContentFragment.js
Created August 31, 2020 20:42
TextBlock Gatsby-Contentful Fragment
View TextBlockContentFragment.js
import { graphql } from "gatsby"
export const TextQuery = graphql`
fragment TextBlock on ContentfulTextBlock {
id
bodyContent {
json
}
sys {
contentType {
@debpu06
debpu06 / FiftyFiftyContentFragment.js
Last active August 31, 2020 20:41
FiftyFiftyContent Gatsby-Contentful Fragment
View FiftyFiftyContentFragment.js
import { graphql } from "gatsby"
export const FiftyFiftyContentQuery = graphql`
fragment FiftyFiftyContent on ContentfulFiftyFifty {
id
sys {
contentType {
sys {
id
}
View gallery.js
@debpu06
debpu06 / TrackController.cs
Created October 10, 2018 04:23
Our API for tracking store interactions using Episerver Insights
View TrackController.cs
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
using EPiServer.Commerce.Catalog.ContentTypes;
using EPiServer.Core;
using EPiServer.Personalization;
View keybase.md

Keybase proof

I hereby claim:

  • I am debpu06 on github.
  • I am debpu06 (https://keybase.io/debpu06) on keybase.
  • I have a public key whose fingerprint is 5F85 B734 390B E39C BC1A B71B 8AC8 CCC7 3F1B F9DF

To claim this, I am signing this object: