sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- Download zsh-autosuggestions by
| const cors = require('cors')({origin: true}); | |
| exports.sample = functions.https.onRequest((req, res) => { | |
| cors(req, res, () => { | |
| res.send('Passed.'); | |
| }); | |
| }); |
| import javax.crypto.Cipher; | |
| import java.io.InputStream; | |
| import java.security.*; | |
| import java.util.Base64; | |
| import static java.nio.charset.StandardCharsets.UTF_8; | |
| public class RsaExample { | |
| public static KeyPair generateKeyPair() throws Exception { | |
| KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA"); |
| <!-- | |
| <form autocomplete="off"> will turn off autocomplete for the form in most browsers | |
| except for username/email/password fields | |
| --> | |
| <form autocomplete="off"> | |
| <!-- fake fields are a workaround for chrome/opera autofill getting the wrong fields --> | |
| <input id="username" style="display:none" type="text" name="fakeusernameremembered"> | |
| <input id="password" style="display:none" type="password" name="fakepasswordremembered"> | |
| var accounts = [ | |
| { name: 'James Brown', msgCount: 123 }, | |
| { name: 'Stevie Wonder', msgCount: 22 }, | |
| { name: 'Sly Stone', msgCount: 16 }, | |
| { name: 'Otis Redding', msgCount: 300 } // Otis has the most messages | |
| ]; | |
| // get sum of msgCount prop across all objects in array | |
| var msgTotal = accounts.reduce(function(prev, cur) { | |
| return prev + cur.msgCount; |
$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>| /* Using this directive is as easy as 1, 2, 3. | |
| 1. Grab the Tableau API JavaScript library as well as this module. | |
| a. <script src="path/to/tableau-2.0.0.min.js"></script> | |
| b. <script src="path/to/angular-tableau.js"></script> | |
| 2. Import the module into your app by adding 'angular-tableau' to your dependencies. | |
| 3. Use the directive like this: | |
| <tableau-viz height="'500px'" | |
| url="path/to/tableau-dashboard" | |
| filters={'field1':['item1', 'item2'], 'dateField':{'min':startDate, 'max':endDate}}"> | |
| </tableau-viz> |
Tested with Chrome, Firefox and Safari.
The following code will not trigger an alert.
target.innerHTML = "<script> alert('XSS Attack'); </script>";
The following code will trigger an alert.
target.innerHTML = "";
| function sec2time(timeInSeconds) { | |
| var pad = function(num, size) { return ('000' + num).slice(size * -1); }, | |
| time = parseFloat(timeInSeconds).toFixed(3), | |
| hours = Math.floor(time / 60 / 60), | |
| minutes = Math.floor(time / 60) % 60, | |
| seconds = Math.floor(time - minutes * 60), | |
| milliseconds = time.slice(-3); | |
| return pad(hours, 2) + ':' + pad(minutes, 2) + ':' + pad(seconds, 2) + ',' + pad(milliseconds, 3); | |
| } |
http://angular.github.io/protractor/#/api
Note: Most commands return promises, so you only resolve their values through using jasmine expect API or using .then(function()) structure
Based on this post: https://spagettikoodi.wordpress.com/2015/01/14/angular-testing-cheat-sheet/ by @crystoll
browser.get('yoururl'); // Load address, can also use '#yourpage'