Skip to content

Instantly share code, notes, and snippets.

View necccc's full-sized avatar

Szabolcs Szabolcsi-Toth necccc

View GitHub Profile
@necccc
necccc / no_ligature.css
Created October 21, 2019 06:51
Gist for This month I've learned - December
.no-ligature {
font-variant-ligatures: none;
}
@necccc
necccc / StarshipList.jsx
Created October 20, 2019 20:14
Gist for "Next.js & Apollo GraphQL Performance Tuning: From Lists to Details"
// our GraphQL Query,
// get the name and ID of some Starships
export const getStarships = gql`
query getStarships {
starshipList {
items {
name
id
}
# deprecate a single version
npm deprecate [email protected] "this version is not supported any more, pelase update"
# deprecate everything below a version
# mind the double-qoutes around the version information!
npm deprecate my-module@"< 1.0.4" "critical bug fixed in 1.0.4, please update"
@necccc
necccc / arguments_relationship-strict_mode.js
Created October 20, 2019 14:20
Gist for When arguments are mutable
// using strict mode
var fn3 = function (a) {
"use strict";
a = "foo"
console.log(arguments[0])
}
// arguments, and the arguments object no longer track each other
fn3(2) // 2
# cache this kind of resource for an hour
type Person@cacheControl(maxAge: 3600) {
id: ID!
name: String!
height: Int
bio: String
# cache the image field for a week
picture: String @cacheControl(maxAge: 10080)
@necccc
necccc / Starships.jsx
Created October 20, 2019 13:53
Gists for Next.js & Apollo GraphQL Performance Tuning: Lists & pagination
// our GraphQL Query,
// get the name and ID of some Starships
export const getStarships = gql`
query getStarships {
starshipList {
items {
name
id
}
@necccc
necccc / RelatedPeople.jsx
Created October 19, 2019 07:31
Gists for "Next.js & Apollo GraphQL Performance Tuning: Subtree Pagination"
<RelatedPeople
id={ '' }
pageData={{
first,
offse,
total
}}
data={ [ {}, {} ] }
onLoadMore={ () => {} }
@necccc
necccc / tito-ticket-overlay.css
Created October 24, 2018 09:16
Tito Ticket overlay custom CSS messages
div.registration_billing_address_vat_number:after {
display: block;
content: "If you buy your ticket as an individial, or you don\'t have an EU VAT number, please enter a number 0 here";
width: 100%;
color: #777;
margin-top: 4px;
margin-bottom: 4px;
font-size: 12px;
@necccc
necccc / random1024.js
Created January 26, 2018 20:45
random 1024 bytes of binary data
const crypto = require('crypto')
const fs = require('fs')
const util = require('util')
const writeFile = util.promisify(fs.writeFile)
const randomBytes = util.promisify(crypto.randomBytes)
void async function () {
const data = await randomBytes(1024)
@necccc
necccc / index.html
Created January 25, 2018 16:02
Binary stream example using Fetch
<!DOCTYPE HTML>
<html>
<head>
<title>Binary streaming using Fetch</title>
</head>
<body>
<h1>Binary streaming using Fetch</h1>
<img src="">