Skip to content

Instantly share code, notes, and snippets.

View sanscheese's full-sized avatar
🅱️

Ben Sheedy sanscheese

🅱️
View GitHub Profile
@sjelfull
sjelfull / geolocation.ts
Created April 26, 2022 07:00
Netlify Edge Functions: Geolocation example
import type { Context } from "netlify:edge";
import {
Cookie,
setCookie,
} from "https://deno.land/std@0.78.0/http/cookie.ts";
import { CookieJar } from "https://deno.land/x/cookies/mod.ts";
let bots = [
// generic
'bot', // googlebot, bingbot, telegrambot, twitterbot, yandexbot, etc.
@davestewart
davestewart / helpers.js
Last active November 26, 2019 04:31
Vue "route helpers" example
/**
* Helper function to reduce boilerplate in route creation
*
* @param {string} path The route's path
* @param {object} page A page component definition
* @param {Function} page A function that returns a page import
* @param {string} page A string path to a file in the view/pages folder
* @param {object} attrs Any additional attributes
*/
export function route (path, page, attrs = {}) {
const { setContext } = require('apollo-link-context');
const { HttpLink } = require('apollo-link-http');
const { introspectSchema, makeRemoteExecutableSchema } = require('graphql-tools');
const fetch = require('node-fetch');
module.exports = function(api) {
api.createSchema(async function(graphql) {
const http = new HttpLink({
uri: 'http://example.com/api',
fetch
@simonswiss
simonswiss / index.md
Last active October 26, 2018 14:10
Front End Development - Learning Resources

Podcasts

https://syntax.fm: A Tasty Treats Podcast for Web Developers. // Hosted by Wes Bos and Scott Tolinski

https://shoptalkshow.com: An internet radio show about the internet. // Hosted by Chris Coyier and Dave Rupert

http://www.fullstackradio.com: A podcast for developers interested in building great software products. // Hosted by Adam Wathan

https://devmode.fm: A podcast dedicated to modern web development. // Hosted by Andrew Welch + panel 🎉