Skip to content

Instantly share code, notes, and snippets.

View jlengstorf's full-sized avatar
💭
partyin

Jason Lengstorf jlengstorf

💭
partyin
View GitHub Profile
@jlengstorf
jlengstorf / workshop-prep.md
Created March 20, 2018 14:47
Jazz Con Functional Programming workshop prep steps.

Functional Programming in JavaScript with Ramda

Here's what you'll need to get ready for this workshop:

  1. A laptop with the latest version of Google Chrome installed (get Chrome here)
  2. Clone the JS exercise repo: git clone git@github.com:jlengstorf/learn-fp-exercises.git)
  3. Clone the Ramda exercise repo: git clone git@github.com:jlengstorf/workshop-fp-ramda.git)
  4. Familiarize yourself with Chrome's dev tools, which we'll be using for the majority of the workshop
    • This is optional; you can also use your preferred editor
@jlengstorf
jlengstorf / *schema-stitching-in-graphql-with-gramps.md
Last active January 15, 2018 04:05
Schema stitching in GrAMPS with two external data sources.

Schema Stitching in GrAMPS Using External Data Sources

In this example, we install two GrAMPS data sources from npm, then extend the schema to allow one data source to access data on the other.

@jlengstorf
jlengstorf / 1-gateway-using-prepare.js
Created January 11, 2018 22:29
An example of a GraphQL gateway set up using the `prepare()` function from GrAMPS.
import Express from "express";
import getPort from "get-port";
import bodyParser from "body-parser";
import { prepare } from "@gramps/gramps";
import { GraphQLSchema } from "graphql";
import { graphqlExpress, graphiqlExpress } from "apollo-server-express";
const MyDataSource = {
namespace: "Test",
typeDefs: `type Query { getVal: String }`,
@jlengstorf
jlengstorf / *README.md
Created December 18, 2017 03:37
A quickstart server for GrAMPS

GrAMPS Quickstart

This is a minimal GraphQL gateway powered by GrAMPS 1.0. It sets up a /graphql endpoint + a GraphiQL interface and pulls in the xkcd GrAMPS data source.

This is useful for testing the following scenarios:

  1. Seeing @gramps/gramps in action and testing @gramps/cli with a custom gateway (see yarn dev).
  2. Testing the override of local data sources in development.
  • To test this:
@jlengstorf
jlengstorf / README.md
Created October 23, 2014 23:30
Simple Mandrill Setup

Mandrill in PHP

This is a simple Mandril integration that sends emails from a script using the Mandrill API.

@jlengstorf
jlengstorf / README.md
Last active August 29, 2015 14:07
Base typography for Hoverboard child themes

Default Typography for WordPress

Use this file to set up default responsive typography rules for a WordPress site.

WordPress Aligment Classes

Includes out-of-the-box support for WordPress alignment classes (.aligncenter, .alignleft, .alignright).

Automatically Set a Featured Image on WordPress Posts

Add these functions to your functions.php to automatically assign a featured image for each post.

Usage

This function must be called within the loop. The first parameter is the post content, and the second is the image size to load.

php
@jlengstorf
jlengstorf / README.md
Last active January 20, 2022 07:21
Bootstrap styling for Gravity Forms, LESS style.

Bootstrap Styles for Gravity Forms in LESS

Include these styles in any project using Bootstrap (with LESS) and Gravity Forms to add good baseline styles for your GF Forms.

@jlengstorf
jlengstorf / README.md
Created October 8, 2014 20:28
Adds responsive embedding to WordPress oEmbed content.

Responsive Embeds in WordPress

This snippet filters oEmbed output in WordPress (the_content()) to force responsive embeds.

Usage

To use, add the contents of responseive_embeds.less to your site's stylesheet (if you're not using LESS, don't forget to move the iframe,object,embed rule outside of .embed-container and change it to .embed-container iframe,.embed-container object,.embed-container embed).

Then add the responsive_embed() function to your theme's functions.php and insert the add_filter() call in your theme's setup function.

@jlengstorf
jlengstorf / related-posts.php
Last active August 29, 2015 14:06
A simple way to load related posts using WordPress categories.