Skip to content

Instantly share code, notes, and snippets.

@shrugs
shrugs / README.md
Created October 21, 2019 09:26
apollo + next

these are the relevant files from my next + apollo + prisma setup. the prisma bit isn't relevant and can just be removed from the context. likewise my resolvers + typedefs setup is hyper specific and there are infinitely many way to do this (lol javascript)

the only relevant bit that might be missing is the handler path that has to match your next.js route

@smitshilu
smitshilu / Tensorflow_Build_GPU.md
Last active June 9, 2020 18:27
Tensorflow 1.4 Mac OS High Sierra 10.13 GPU Support

Tensorflow

System information

  • OS - High Sierra 10.13
  • Tensorflow - 1.4
  • Xcode command line tools - 8.2 (Download from here: Xcode - Support - Apple Developer & Switch to different clang version: sudo xcode-select --switch/Library/Developer/CommandLineTools & check version: clang -v)
  • Cmake - 3.7
  • Bazel - 0.7.0
@gatsbyjs-employees
gatsbyjs-employees / Open letter to the Gatsby community.md
Last active February 23, 2021 00:24
Open letter to the Gatsby community

To the Gatsby Community,

We want to start by specifically thanking Nat Alison. We support her and commend her bravery in speaking out. It is not easy to stand alone. What she experienced at Gatsby was unacceptable and speaks to wider issues. We thank her for putting pressure on the company to fix them. We vow to double down on those efforts.

While we have worked hard to give feedback and help create a healthy work environment over the past few years, change has been far too slow and the consequences have been real. The previous weeks have intensified the need for rapid change by increasing employee communication and allowing us to collectively connect some dots. We are just as outraged. As a result, we have posed a series of hard questions to management as well as a list of concrete actions they need to take.

Kyle Mathews' public apologies to both Nat Alison and Kim Crayton are small actions swiftly taken that signal the possibility for change but don't speak to the systemic issues that must be addressed.

@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: {
/* eslint-enable no-param-reassign */
function genId() {
const num = uuid();
return `graphql__${num}`;
}
function uuid() {
return 'xxxxxxxx'.replace(/[xy]/g, function (c) {
var r = (Math.random() * 16) | 0,
@jakub-g
jakub-g / hn.md
Last active January 19, 2023 04:21
Hacker News Links

Hacker News "hidden" URLs

Many of HN URLs are not easily discoverable as there are no links to them in a prominent part on the page, or sometimes even nowhere. The following is a list of links to standard and "special" HN pages. The ones is bold are the less discoverable ones.

See also: https://github.com/minimaxir/hacker-news-undocumented

Posts

Elon Musk's suspension reversals

The tables below show notable Twitter suspension reversals for each day since Elon Musk took over as owner and CEO.

All dates indicate when the suspension or reversal was detected, and the actual suspension or reversal may have been earlier. For most English-language accounts with large followings, this lag will generally not be longer than a few hours, but for accounts that have a small number of followers or that are outside the networks we are tracking, the difference can be larger, and in some cases an account on the list may have had its suspension reversed before 27 October 2022. These dates will get more precise as we refine the report.

Because of these limitations, this report should be considered a starting point for investigation, not a definitive list of suspension reversals.

@bkeating
bkeating / graphiql-dark-mode.css
Last active April 25, 2023 13:31
GraphiQL One Dark Alt (Dark Mode) theme by Ben Keating
<style>
/* GraphiQL One Dark Alt (Dark Mode) theme by Ben Keating[1]
* Colors taken from Atom's One Dark theme[2]. Add this file to the end of
* your <head> block[3] to override built-in default styling.
*
* [1]. https://twitter.com/flowpoke
* [2]. https://github.com/atom/atom/tree/master/packages/one-dark-ui
* [3]. e.g. `.../site-packages/graphene_django/templates/graphene/graphiql.html`
*/
@nfarina
nfarina / AutoThemeSwitcher.js
Created May 14, 2019 19:04
Auto Dark Theme for Storybook
import addons from '@storybook/addons';
import { FORCE_RE_RENDER } from '@storybook/core-events';
import { themes } from '@storybook/theming';
// Automatically switch light/dark theme based on system pref.
addons.register("auto-theme-switcher", api => {
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)');
let lastTheme;
@threepointone
threepointone / for-snook.md
Last active August 26, 2023 15:43
For Snook

https://twitter.com/snookca/status/1073299331262889984?s=21

‪“‬In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”

‪Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows. ‬

‪(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)‬

So the big deal about css-in-js (cij) is selectors.