Skip to content

Instantly share code, notes, and snippets.

View josemarluedke's full-sized avatar

Josemar Luedke josemarluedke

View GitHub Profile
@josemarluedke
josemarluedke / from-introspection-schema-result-to-graphql-sdl.js
Created April 3, 2019 14:31
Generate a SDL graphql string from a introspection schema result
const { buildClientSchema, printSchema } = require('graphql');
const fs = require('fs');
const introspectionSchemaResult = JSON.parse(
fs.readFileSync('./graphql.schema.json')
);
const graphqlSchemaObj = buildClientSchema(introspectionSchemaResult);
const sdlString = printSchema(graphqlSchemaObj);
{
"editor.tabSize": 2,
"editor.formatOnSave": true,
"explorer.confirmDragAndDrop": false,
"[handlebars]": {
"editor.formatOnSave": false
},
"[graphql]": {
"editor.formatOnSave": false
},
@josemarluedke
josemarluedke / ember-oo-modifiers-index.d.ts
Created April 17, 2019 04:24
Typescript type definitions for ember-oo-modifiers
declare module 'ember-oo-modifiers' {
export default class Modifier<T = object, T2 = unknown[]> {
public element: HTMLElement;
public constructor(attrs: T, _owner: unknown);
public static modifier(Klass: unknown): unknown;
public didInsertElement(positional: T2, args: T): void;
public didRecieveArguments(positional: T2, args: T): void;
public didUpdateArguments(positional: T2, args: T): void;
@josemarluedke
josemarluedke / index.d.ts
Created May 4, 2019 04:41
Ember FastBoot service typescript type definitions
declare module 'ember-cli-fastboot/services/fastboot' {
import Service from '@ember/service';
interface Request {
method: string;
body: unknown;
cookies: unknown;
headers: unknown;
queryParams: unknown;
path: string;
function hexToHSL(H) {
// Convert hex to RGB first
let r = 0, g = 0, b = 0;
if (H.length == 4) {
r = "0x" + H[1] + H[1];
g = "0x" + H[2] + H[2];
b = "0x" + H[3] + H[3];
} else if (H.length == 7) {
r = "0x" + H[1] + H[2];
g = "0x" + H[3] + H[4];
@josemarluedke
josemarluedke / release-drafter.yml
Last active November 10, 2019 02:18
My Release Drafter configuration
# Configuration for Release Drafter - https://github.com/toolmantim/release-drafter
name-template: v$NEXT_MINOR_VERSION
tag-template: v$NEXT_MINOR_VERSION
categories:
- title: ':boom: Breaking Change'
label: 'Type: Breaking Change'
- title: ':rocket: Enhancement'
label: 'Type: Enhancement'

<ChangesetForm>

The <ChangesetForm> component binds an instance of ember-changeset to a <form> tag. This binding is achieved through the component's {{yield}}, which is a hash of form controls that interface with the underlying changeset object.

Here's a list of yielded form components,

Hash Name Component
Text <InputText>
Textarea ``
app
├── app.js
├── authenticated-route.ts
├── authenticators
│   ├── oauth2-authorization-code.ts
│   └── oauth2-password.ts
├── breakpoints.js
├── config
│   └── environment.d.ts
├── helpers
app
├── app.js
├── authenticated-route.ts
├── authenticators
│ ├── oauth2-authorization-code.ts
│ └── oauth2-password.ts
├── breakpoints.js
|── components
│   ├── change-password-form
│   │   ├── index.ts
const visit = require('unist-util-visit');
const escapeHBS = node => {
if(!node.value) {
return;
}
if (((/^({{|<[A-Z]|<\/[A-Z])/g)).test(node.value)) {
node.type = 'html';
}
}