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
const Generator = require('yeoman-generator'); | |
// => We include InputValidate | |
const { List, Input, InputValidate } = require('@webpack-cli/webpack-scaffold'); | |
module.exports = class WebpackGenerator extends Generator { | |
/* ... */ | |
prompting() { | |
// => We create a validator function that takes the user input as parameter | |
const validateName = (value) => { | |
// => If it contains space it's not a valid name |
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
const Generator = require('yeoman-generator'); | |
const { List, Input, InputValidate } = require('@webpack-cli/webpack-scaffold'); | |
/* ... */ |
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
const Generator = require('yeoman-generator'); | |
// => We import the helper functions | |
const { List, Input } = require('@webpack-cli/webpack-scaffold'); | |
module.exports = class WebpackGenerator extends Generator { | |
constructor(args, opts) { /* ... */ } | |
prompting() { | |
return this.prompt([ | |
// => Input, asks the user to write a response |
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
const Generator = require('yeoman-generator'); | |
module.exports = class WebpackGenerator extends Generator { | |
constructor(args, opts) { | |
super(args, opts); | |
// => We will initialize our generator here | |
} | |
prompting() { | |
// => This is were we will print the questions to get the user preferences | |
} |
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
linear-gradient(60deg, #f79533, #f37055, #ef4e7b, #a166ab, #5073b8, #1098ad, #07b39b, #6fba82) |
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
<!-- | |
This disables app transport security and allows non-HTTPS requests. | |
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better | |
approach is to fix the non-secure resources. However, this patch will work in a pinch. | |
To apply the fix in your Ionic/Cordova app, edit the file located here: | |
platforms/ios/MyApp/MyApp-Info.plist | |
And add this XML right before the end of the file inside of the last </dict> entry: |
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
/* | |
* Based on https://gist.github.com/583836 from http://stackoverflow.com/questions/3709391/node-js-base64-encode-a-downloaded-image-for-use-in-data-uri. | |
* / | |
var http = require('http') | |
var Stream = require('stream').Transform | |
http.request(url, function(response) { | |
var data = new Stream(); |
NewerOlder