Skip to content

Instantly share code, notes, and snippets.

View stolinski's full-sized avatar
💭
Syntax.fm

Scott Tolinski stolinski

💭
Syntax.fm
View GitHub Profile
@swyxio
swyxio / readme.md
Last active January 16, 2022 10:36
svelte society day talks and resources -
@TrillCyborg
TrillCyborg / apollo.ts
Created November 14, 2019 21:08
Next.js / Accounts.js
import fetch from 'isomorphic-unfetch'
import { ApolloClient } from 'apollo-client'
import { ApolloLink } from 'apollo-link'
import { createHttpLink } from 'apollo-link-http'
import { InMemoryCache, NormalizedCacheObject } from 'apollo-cache-inmemory'
import { AccountsGraphQLClient } from '@accounts/graphql-client'
import { AccountsClientPassword } from '@accounts/client-password'
import { AccountsClient } from '@accounts/client'
import { accountsLink } from '@accounts/apollo-link'
import { tokenStorage } from './token-storage'
@mfellner
mfellner / graphql.ts
Created July 8, 2019 20:42
Using Apollo Server in Next.js 9 with API route in pages/api/graphql.ts
import { ApolloServer, gql } from 'apollo-server-micro';
const typeDefs = gql`
type Query {
sayHello: String
}
`;
const resolvers = {
Query: {
import PropTypes from 'prop-types';
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
type Defined<T> = T extends undefined ? never : T;
/**
* Get the type that represents the props with the defaultProps included.
*
* Alternatively, we could have done something like this:
////////////
// MIXINS //
////////////
/*------------------------------------*\
FONTS
\*------------------------------------*/
/*--General--*/
@benschaaf
benschaaf / template.php
Created November 21, 2013 20:19
Wrap the link title in a span, that will get display none. I could have also just removed the title, but I wanted it there for SEO (I guess)
<?php
function ross_menu_link__menu_block__menu_social(array $variables) {
$element = $variables['element'];
$sub_menu = '';
if ($element['#below']) {
$sub_menu = drupal_render($element['#below']);
}
$element['#localized_options']['html'] = TRUE;
@balupton
balupton / README.md
Last active April 20, 2022 13:21
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo