Skip to content

Instantly share code, notes, and snippets.

View captbaritone's full-sized avatar
💭
-=[ Dorkin' Out ]=-

Jordan Eldredge captbaritone

💭
-=[ Dorkin' Out ]=-
View GitHub Profile
@captbaritone
captbaritone / live-resolvers.md
Created September 20, 2023 05:07
Dropping Live Resolver Docs [Raw]

0. Relay Live Resolvers

Relay Liver Resolvers are an experimental Relay feature which lets you extend your server’s GraphQL schema to include additional client state. For example, you might want to expose data from a legacy state management solution or from IndexDB to your Relay components.

Your experience writing GraphQL resolvers on the server should mostly apply to writing Live Resolvers. The main distinction is that Live Resolvers are reactive. Instead of just reading a single values, Live Resolvers model a value that might change over time, similar to an observable.

Pages

@captbaritone
captbaritone / mandala.php
Created November 17, 2012 03:25
Drawing mandalas with PHP
<?php
// Prints a mondala
$points = $_GET['points'];
$size = $_GET['size'];
// Test the size
if($size < 1 || $size > 1024){
echo "Please use a better size";
// Test the number of points
}elseif($points < 1 || $points > 100){
echo "Please use a more reasonable number or points";
@captbaritone
captbaritone / avatar.jpg.php
Created November 17, 2012 03:20
PHP: Avatar Hack
<?php
/*-------------------------
|
| Instructions
|
\-------------------------*/
// Name this file index.php and place it in a folder named avatar.jpg on your server
// Then, when asked for your avatar url, give the location of the folder "avatar.jpg"

This rule lints for non-colocated fragment spreads within queries or fragments. In other words, situations where a fragment is spread in module A, but the module (B) that defines that fragment is not imported by module A. It does not lint subscriptions or mutations. This catches:

  • The anti-pattern of spreading a fragment in a parent module, then passing that data down to a child module, or jamming it all in context. This defeats the purpose of Relay. From the Relay docs – "[Relay] allows components to specify what data they need and the Relay framework provides the data. This makes the data needs of inner components opaque and allows composition of those needs."
  • Instances where fragment spreads are unused, which results in overfetching. In addition to consuming more gCPU, it can also sometimes cause SEVs: D19057571

When the fragment is unused

The easiest way to tell if a fragment is unused is to remove the line containing the lint error, run js1 rebuild relay, the

LIST OF THE [4,011] OPERA RECORDINGS IN THE CCDB AS OF JANUARY 25, 2013:
Composer - Opera (year.month.day) Conductor [singers] (CCDB ID) [format(s)]
Adam, Adolphe - Le Farfadet (1970.9.4) Benedetti, Robert [Dachary, Peyron, Demigny] (CCDB 3808) [mp3]
Adam, Adolphe - Le Postillon de Lonjumeau (1968.4) Bauer-Theussl, Franz [Dallapozza, Boky, Papouschek] (CCDB 7451) [mp3]
Adam, Adolphe - Le Postillon de Lonjumeau (1985.9) Fulton, Thomas [roux, Lafont, Anderson] (CCDB 3804) [mp3]
Adam, Adolphe - Le Toréador (1996.6) Bonynge, Richard [Tempont, Jo, Aler] (CCDB 3806) [mp3]
Adam, Adolphe - Le Toréador (2003.12.8) Tingaud, Jean-Luc [Barrard, Léger, Edwards] (CCDB 7452) [mp3]
Adam, Adolphe - Si j'étais roi (1960) Blareau, Richard [Berton, Mallabrera, Héral] (CCDB 3809) [mp3]
@captbaritone
captbaritone / UserSongs.plist
Created August 21, 2013 02:44
Chord changes from iRealb
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>chordProgression</key>
<string>*A[T44F^7 Ab7 |Db^7 E7 |A^7 C7 |C-7 F7 |Bb^7 Db7 |Gb^7 A7 |D-7 G7 |G-7 C7 ]*A[F^7 Ab7 |Db^7 E7 |A^7 C7 |C-7 F7 |Bb^7 Ab7 |Db^7 E7 |A^7 C7 |F^7 ]*B[C-7 F7 |E-7 A7 |D^7 F7 |Bb^7 |Eb-7 |Ab7 |Db^7 |G-7 C7 ]*A[F^7 Ab7 |Db^7 E7 |A^7 C7 |C-7 F7 |Bb^7 Ab7 |Db^7 E7 |A^7 C7 |F^7 Z</string>
<key>composer</key>
<string>Coltrane John</string>
<key>keySignature</key>
'use strict';
const {ROOT_DIR} = require('../../utils/config/index.js');
var fs = require('fs');
const OSS_DIR = `${ROOT_DIR}/xplat/js/RKJSModules/Libraries/Relay/oss`;
const COMPILER_TARGETS_FILE = `${ROOT_DIR}/fbcode/relay/oss/crates/relay-compiler/TARGETS`;
const COMPILER_CARGO_FILES = [
`${ROOT_DIR}/fbcode/relay/oss/crates/relay-compiler/Cargo.toml`,
`${ROOT_DIR}/fbcode/relay/oss/Cargo.oss.lock`,
];
const EQUALITY_OPERATORS = new Set(['==', '===', '!=', '!==']);
module.exports = {
meta: {
messages: {
constant: 'Constant condition.',
coalescingNeverNullish: 'Constant condition. Value can never be nullish.',
coalescingAlwaysNullish:
'Constant condition. Value will always be nullish.',
},
╭─[23:32]: jordaneldredge at Jordans-MacBook-Pro in ~/projects/skin-scrapers/niko-niko.net
╰─➤ find . | grep -i zip | wc -l
218
╭─[23:32]: jordaneldredge at Jordans-MacBook-Pro in ~/projects/skin-scrapers/niko-niko.net
╰─➤ find . | grep -i zip
./winamp/Zel.ZIP
./winamp/shin.zip
./winamp/rasen7.zip
./winamp/naus.ZIP
@captbaritone
captbaritone / index.js
Created September 24, 2019 14:15
maki compiler as a service
const express = require("express");
const path = require("path");
const fsExtra = require("fs-extra");
const os = require("os");
const app = express();
const port = 3000;
const { exec } = require("child_process");
const Busboy = require("busboy");
const tmpDir = os.tmpdir();