Skip to content

Instantly share code, notes, and snippets.

View grxy's full-sized avatar
🇺🇸

Grex grxy

🇺🇸
View GitHub Profile
@daemonsy
daemonsy / schema-design-notes.md
Created September 30, 2019 19:24
Notes on Talk by Marc Andre Giroux on GraphQL Schema design

https://www.youtube.com/watch?v=pJamhW2xPYw&feature=youtu.be

GraphQL in Github

  • API first (each feature comes with its GraphQL API now)
  • GraphQL schema designed and built by product team (domain experts)
  • API team supports the process (technology experts)

Guiding Principles

  • Design for use cases / behavior over data
  • Anemic GraphQL (all data exposed but the schema is not useful to anyone)
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}