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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ " |
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
// CoffeeScript | |
getPartNumber = (car) -> | |
car?.getMake()?.model?.partNumber | |
return | |
// JavaScript | |
const getPartNumber = function(car) { | |
__guard__(__guard__(car != null ? car.getMake() : undefined, x1 => x1.model), x => x.partNumber); | |
}; | |
function __guard__(value, transform) { |
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
// JavaScript | |
class SportCar extends Car { | |
constructor(model, wheelsProperties) => { | |
super(); | |
this.model = model; | |
this.wheelsProperties = wheelsProperties; | |
} | |
} | |
class Car { |
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
// Coffeescript | |
class SportCar extends Car | |
constructor: (@model, @wheelsProperties) -> | |
super() | |
class Car | |
constructor: () -> | |
computeWheelMaintenance() | |
computeWheelMaintenance: -> |
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
// (1) Coffeescript | |
class Car | |
constructor: (@model) -> | |
// (2) JavaScript (ES6) | |
class Car { | |
constructor(model) => { | |
this.model = model | |
} | |
} |
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
componentDidMount() { | |
return this.fetchRecords(); | |
} |