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
#!/bin/bash | |
# START=$(perl -MTime::HiRes=time -e 'printf "%.9f\n", time') | |
####################################################### | |
# EXPORTS | |
####################################################### | |
# Expand the history size |
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
/** | |
* Credits | |
* @Bkucera: https://github.com/cypress-io/cypress/issues/2839#issuecomment-447012818 | |
* @Phrogz: https://stackoverflow.com/a/10730777/1556245 | |
* | |
* Usage | |
* ``` | |
* // Types "foo" and then selects "fo" | |
* cy.get('input') | |
* .type('foo') |
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
// Method to test | |
public uploadFileList(files: FileList) { | |
// whatever | |
} | |
// Test | |
it("uploadFileList", () => { | |
const blob = new Blob([""], { type: "text/html" }); | |
blob["lastModifiedDate"] = ""; | |
blob["name"] = "filename"; |
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
var fs = require('fs'); | |
var path = require('path'); | |
function base64ToPNG(data) { | |
data = data.replace(/^data:image\/png;base64,/, ''); | |
fs.writeFile(path.resolve(__dirname, '../tmp/image.png'), data, 'base64', function(err) { | |
if (err) throw err; | |
}); | |
} |