Skip to content

Instantly share code, notes, and snippets.

Avatar
🔨
Nailing It!

Kitson Kelly kitsonk

🔨
Nailing It!
View GitHub Profile
@kitsonk
kitsonk / lodash_example.ts
Last active Aug 18, 2020
An example of using lodash under Deno in a type safe way.
View lodash_example.ts
// @deno-types="https://unpkg.com/@types/lodash@4.14.135/index.d.ts"
import * as lodash from "https://cdn.pika.dev/lodash-es@^4.17.15";
console.log(Object.keys(lodash));
@kitsonk
kitsonk / bronto.ts
Last active Dec 27, 2020
Example Deno Static Server
View bronto.ts
import {
green,
cyan,
bold,
yellow,
red
} from "https://deno.land/std@v0.20.0/fmt/colors.ts";
import {
Application,
View deno.d.ts
declare module 'deno' {
export = deno;
}
declare namespace deno {
const bytesSymbol: unique symbol;
export class DenoBlob implements domTypes.Blob {
private readonly [bytesSymbol];
@kitsonk
kitsonk / webpack.config.ts
Created Jul 14, 2017
Making Page Bundles for Electron
View webpack.config.ts
import * as webpack from 'webpack';
import { resolve } from 'path';
import { existsSync } from 'fs';
const NormalModuleReplacementPlugin: any = require('webpack/lib/NormalModuleReplacementPlugin');
export = function webpackConfig(): webpack.Configuration {
return {
entry: {
index: './lib/pages/index.js',
@kitsonk
kitsonk / project.json
Created Jun 23, 2017
Dojo 2 Todo MVC TSX
View project.json
This file has been truncated, but you can view the full file.
@kitsonk
kitsonk / README.md
Last active Aug 8, 2017
Working with Intern 3 from vscode
View README.md

Work with Intern from vscode

This document provides an example of how you can configure vscode to test with Intern.

You will need to edit your .vscode/launch.json in the root of your project and follow the example JSON below.

This will provide two "tasks", both being the unit tests, in Node.js and Chrome. The latter needs the Chrome Debugger plugin installed in vscode. You need to tailor the below to match you environment and assumes that intern is installed in the root of node_modules and that you are serving your project root up at localhost:8080.

@kitsonk
kitsonk / project.json
Created Apr 29, 2017
Dojo 2 Hello World
View project.json
This file has been truncated, but you can view the full file.
@kitsonk
kitsonk / README.md
Last active Apr 27, 2017
VSCode running Unit Tests under Node
View README.md

Configuring VSCode to Run Dojo 2 Unit Test

The launch.json can be added to .vscode directory of your project.

This is for most @dojo/* packages that use grunt-dojo2. A different configuration would be required for applications created with dojo create app.

View dojo_basic.css
@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,400,700');
.basic {
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
.visually-hidden {
border: 0;
clip: rect(0 0 0 0);
View createchildexample.ts
import createApp from 'dojo-app/createApp';
import createStatefulChildrenMixin from 'dojo-widgets/mixins/createStatefulChildrenMixin';
import createParentListMixin from 'dojo-widgets/mixins/createParentListMixin';
import createCachedRenderMixin from 'dojo-widgets/mixins/createCachedRenderMixin';
import createRenderableChildrenMixin from 'dojo-widgets/mixins/createRenderableChildrenMixin';
import createWidget from 'dojo-widgets/createWidget';
import createMemoryStore from 'dojo-widgets/util/createMemoryStore';
const widgetStore = createMemoryStore({
data: [