This file contains hidden or 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
#! /usr/local/bin/node | |
"use strict"; | |
var wordsPerLine = 4; | |
var crypto = require("crypto"); | |
var fs = require("fs"); | |
var words = JSON.parse(fs.readFileSync(__dirname + "/words.json").toString("UTF8")).words; | |
var count = words.length; |
This file contains hidden or 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
class A { | |
__identify() { | |
return "Class A" | |
} | |
idNotBound() { | |
return this.__identify() | |
} | |
idBound = () => { |
This file contains hidden or 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
class Alpha { | |
constructor() { | |
this.a = "red"; | |
this.#b = "green"; | |
} | |
identify() { | |
console.log(this.a, this.#b); | |
} | |
} |
This file contains hidden or 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
let arr = [10, 11, 12, 13]; | |
console.log(arr.length); // 4 | |
arr.foo = "bar"; | |
console.log(arr.length); // 4 | |
console.log(1 in arr); // true | |
console.log(arr[10] === undefined); // true | |
console.log(10 in arr); // false |
This file contains hidden or 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
// Pipeline | |
export type PipelineInfo = { | |
pipelineMetadata: any | |
} | |
// Stages | |
export type StageInfo = { | |
name: string, | |
uid: string, | |
pipelineMetadata: any |
This file contains hidden or 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"; | |
const npm_config_argv = process.env.npm_config_argv; | |
if (!npm_config_argv) { | |
console.error("This script should only be run via npm trigger -- npm_config_argv not found in ENV"); | |
process.exit(1); | |
} | |
let isInstall = false; |
This file contains hidden or 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
// Old | |
var docHead = exports.getHeadElement(); | |
var rootURL = getAttribute(docHead, "data-rooturl"); | |
if (!rootURL) { | |
throw "Attribute 'data-rooturl' not defined on the document <head> element."; | |
} | |
// New | |
var docHead = exports.getHeadElement(); | |
var rootURL = getAttribute(docHead, "data-rooturl"); |
This file contains hidden or 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 This: | |
<Route path={rootRoutePath} component={OrganisationPipelines}> | |
<IndexRoute component={Pipelines}/> | |
<Route path=":pipeline/branches" component={MultiBranch}/> | |
<Route path=":pipeline/activity" component={Activity}/> | |
<Route path=":pipeline/pr" component={PullRequests}/> | |
</Route> | |
//To this: |
This file contains hidden or 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 React, {Component} from 'react'; | |
function Alpha(props) { | |
console.log("Alpha props.className", props.className); | |
return <strong className="onStrong">Alpha</strong>; | |
} | |
function Bravo(props) { | |
console.log("Bravo props.className", props.className); | |
return <Alpha className="san"/>; |
This file contains hidden or 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
// All you needed to do if you wanted codegen: | |
[Bindable] | |
public var easyProp:MyClass; | |
// More explicit version using a named event: | |
private var _myProp:MyClass; | |
[Bindable("myPropChange")] | |
public function get myProp():MyClass | |
{ |