I hereby claim:
- I am jnicklas on github.
- I am jnicklastt (https://keybase.io/jnicklastt) on keybase.
- I have a public key ASDJXO9pMbGj2Gaqd62YoqrUpoWN1qqvf7XNjy5AKZ45MQo
To claim this, I am signing this object:
| import { set } from '@ember/object'; | |
| import type { AsyncBelongsTo, AsyncHasMany } from '@ember-data/model'; | |
| type ErrorMessage<T> = { __errorMessage: T }; | |
| export type AssociationSetterValueFrom<T> = | |
| T extends AsyncBelongsTo<infer U> | |
| ? AsyncBelongsTo<U> | U | null | |
| : T extends AsyncHasMany<infer U> | |
| ? U[] |
| import Component from '@glimmer/component'; | |
| import { join } from '@nullvoxpopuli/ember-composable-helpers'; | |
| type SelectArgs = { | |
| options: string[]; | |
| } & ( | |
| | { multiple: true; selected: string[] } | |
| | { multiple?: false; selected: string } | |
| ); |
I hereby claim:
To claim this, I am signing this object:
| // A custom plugin for graphql-codegen, which generate `yup` schemas for input objects | |
| // Loosely based on https://github.com/kazuyaseki/graphql-codegen-yup-schema | |
| module.exports = { | |
| plugin: schema => { | |
| function buildObject(node) { | |
| let fieldsResult = node.fields.map(buildField).filter(Boolean).map((fieldResult) => { | |
| return ` ${fieldResult}`; | |
| }).join(',\n'); | |
| return `yup.object().shape({\n${fieldsResult}\n});` |
| import { run } from 'effection'; | |
| import { once } from '@effection/events'; | |
| run(function*() { | |
| yield konamiCodeEntered(); | |
| alert('99 lives!'); | |
| }); | |
| function * konamiCodeEntered() { | |
| while (true) { |
| class Client | |
| attr_reader :key, | |
| def initialize(key) | |
| @key = key | |
| end | |
| end | |
| Client.new("moo") # results in: ArgumentError: wrong number of arguments (given 1, expected 0) |
Add an annotation to functions that they may "throw" an error type, which changes the function's
return type to Result where T is the functions return type and E is the function's
| const vm = require('vm'); | |
| const repl = require('repl'); | |
| function myEval(cmd, context, filename, callback) { | |
| let result; | |
| try { | |
| result = vm.runInContext(cmd, context); | |
| } catch (e) { | |
| return callback(e); | |
| } |
| begin | |
| require "bundler/inline" | |
| rescue LoadError => e | |
| $stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
| raise e | |
| end | |
| gemfile(true) do | |
| source "https://rubygems.org" | |
| gem "rails", github: "rails/rails" |
| describe "My page" do | |
| it "lists the item" do | |
| item = create_item | |
| within item_row(item) do | |
| expect(page).to mention_item(item) | |
| end | |
| end | |
| private |