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
#!/usr/bin/env node | |
console.log('yay gist'); | |
console.log(process.argv); |
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
#!/usr/bin/env node | |
const fetch = require('node-fetch'); | |
const cheerio = require('cheerio'); | |
const chalk = require('chalk'); | |
fetch('http://kharkivjs.org/') | |
.then(response => response.text()) | |
.then(html => { | |
const $ = cheerio.load(html); |
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
function squareAfter2Seconds(x) { | |
return new Promise(resolve => { | |
setTimeout(() => { | |
resolve(x * x); | |
}, 2000); | |
}); | |
} | |
async function calc() { | |
const a = await squareAfter2Seconds(10); |
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 styles from './styles.js'; | |
redner() { | |
const props = this.props; | |
const classList = classname(props.className, css.button, { | |
[css.primary]: props.primary | |
}); | |
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
export default (props) => { | |
// this is not possible, but I think this is more readable that next example | |
static propTypes = { | |
name: PropsTypes.string.requried | |
}; | |
return <Div>{props.name}</Div>; | |
} |
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
angular.module('example').provider('app.route', ['$routeProvider', function($routeProvider) { | |
return { | |
when: function(path, config) { | |
if (!config.resolve) { | |
config.resolve = {}; | |
} | |
// Add resolver for each registered route | |
config.resolve.permission = 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
angular.module('example').directive('helloWorld', function() { | |
return { | |
restrict: 'E', | |
template: '<div> {{ name }} </div>', | |
link: function(scope, element) { | |
// scope.name = 1; | |
element.addClass('orange')l | |
}, | |
controller: ['$scope', funtion($scope) { | |
$scope.name = 1; |
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
angular.module('example').config(['$routeProvider', function($routeProvider) { | |
$routeProvider.when('/home', { | |
controller: 'home', | |
template: '<div> {{ name }} </div>' | |
}); | |
}]); |
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
angular.module('example').controller('home', ['$scope', function($scope) { | |
$scope.name = 'home'; | |
}); | |
angular.module('example').config(['$routeProvider', function($routeProvider) { | |
$routeProvider.when('/home', { | |
controller: 'home', | |
template: '<div> {{ name }} </div>' | |
}); | |
}]); |
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 Angular from 'valent/angular'; | |
let framework = new Angular({ | |
module: 'your-application-name' | |
}); | |
valent.bootstrap(framework); |
NewerOlder