Skip to content

Instantly share code, notes, and snippets.

View extractgqlts-usage.ts
import type {
WatchQueryOptions as QueryOptionsBase,
SubscriptionOptions as SubscriptionOptionsBase,
MutationOptions as MutationOptionsBase,
} from '@apollo/client';
import type { DocumentNode } from 'graphql';
import { parse } from 'graphql';
import type { ReadableQuery, ReadableResult } from 'svelte-apollo';
import * as sa from 'svelte-apollo';
import type { QueryTypes } from '~/src/lib/graphql/types.generated';
View panel.go
package term
import (
"fmt"
"strings"
"github.com/deref/exo/internal/util/mathutil"
)
// Zero value is ready to use. Operations on panel affect Stdout.
View versioning.md

Versioning

This project uses $SOME_CUTE_VERSIONING_SCHEME_NAME. It works like this:

Version numbers have the short form:

<major>.<minor>

Stability

View antd-peer-deps.sh
#!/bin/bash
set -ex
repos='
animate
cascader
checkbox
collapse
dialog
@brandonbloom
brandonbloom / dev
Created August 27, 2020 18:32
Go: build & run command script
View dev
#!/bin/bash
set -e
if [ "$#" == "0" ]; then
echo "Usage: $0 <cmd> <args...>" > /dev/stderr
exit 1
fi
cmd=$1
View workers.js
let mutex = Promise.resolve();
let counter = 0;
const read = async () => counter;
const write = async (value) => {
counter = value;
}
View namespaced_methods.clj
(ns hr)
(defprotocol Employee
(fire [this]))
(ns war)
(defprotocol Missile
(fire [this]))
View rectangle.ruby
class Rectangle
include Model
attr_accessor :left, :right, :top, :bottom, :width
def computed_width
return unless left and right
right - left
end
View feed.rb
module Model
def initialize(attributes)
self.attributes = attributes
end
def attributes=(hash)
hash.each do |k, v|
send :"#{k}=", v
end
end
View jit.t
local C = terralib.includecstring [[
#include <stdio.h>
]]
function makeAdder(x)
print("makeAdder(" .. x .. ")")
return terra(y : int)
return x + y
end
end