This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// App | |
import { Component } from '@angular/core'; | |
@Component({ | |
selector: 'app', | |
template: '<span>{{ sayHello() }}</span>', | |
}) | |
export class App { | |
public name: string = 'John'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* Module dependencies. | |
*/ | |
const webdriver = require('selenium-webdriver'); | |
/** | |
* Build driver. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {action1, action2} from "myActions"; | |
import {bindActionCreators} from "redux"; | |
const mapDispatchToProps(dispatch) => { | |
return { | |
manuallyBoundAction : (...args) => dispatch(action1(...args)), | |
autoBoundAction : bindActionCreators(action2, dispatch), | |
multipleActionsTogether : bindActionCreators({action1, action2}, dispatch) | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// approach 1: define action object in the component | |
this.props.dispatch({ | |
type : "EDIT_ITEM_ATTRIBUTES", | |
payload : { | |
item : {itemID, itemType}, | |
newAttributes : newValue, | |
} | |
}); | |
// approach 2: use an action creator function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// approach 1: define action object in the component | |
this.props.dispatch({ | |
type : "EDIT_ITEM_ATTRIBUTES", | |
payload : { | |
item : {itemID, itemType}, | |
newAttributes : newValue, | |
} | |
}); | |
// approach 2: use an action creator function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* TypeScript type definitions for the JSON-Placeholder | |
* sample data API. | |
* @see https://jsonplaceholder.typicode.com/ | |
*/ | |
export interface User { | |
id: number; | |
name: string; | |
username: string; | |
email: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Running the fast-check property-based testing library in the Deno | |
* JavaScript/TYpeScript runtime. | |
* See: https://github.com/dubzzz/fast-check | |
* | |
* This file contains all the 'simple' examples from the fast-check | |
* repo using Deno.test for the test functions and assertions | |
* from the Deno standard library. I also added some missing type | |
* annotations. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file assures that a Jest test file and Cypress test file exists for each component. | |
import path from "path"; | |
import fs from "fs"; | |
function getFiles(filepath: string) { | |
return fs.readdirSync(filepath).filter(function (file) { | |
return fs.statSync(path.join(filepath, file)).isFile(); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Compiling SASS with Deno | |
deno run --allow-read="test.scss" --allow-env="SASS_PATH" --unstable "test.ts"``` | |
*/ | |
import SassLang from "npm:sass@latest"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from Fresh repo at: https://github.com/denoland/fresh/blob/4a8bfc03278068cffb017ed08d3eb891d7509c37/www/utils/markdown.ts#L13 | |
export * as gfm from "https://deno.land/x/[email protected]/mod.ts"; | |
import "https://esm.sh/[email protected]/components/prism-jsx.js?no-check"; | |
import "https://esm.sh/[email protected]/components/prism-typescript.js?no-check"; | |
import "https://esm.sh/[email protected]/components/prism-tsx.js?no-check"; | |
import "https://esm.sh/[email protected]/components/prism-diff.js?no-check"; | |
import "https://esm.sh/[email protected]/components/prism-json.js?no-check"; | |
import "https://esm.sh/[email protected]/components/prism-bash.js?no-check"; | |
import "https://esm.sh/[email protected]/components/prism-yaml.js?no-check"; |
OlderNewer