-
After installing mitmproxy run it (just type
mitmproxy
) in a terminal session and quit. This will create the necessaries certificates files at~/.mitmproxy
. -
Extract the certificate to
.crt
format:
openssl x509 -in ~/.mitmproxy/mitmproxy-ca.pem -inform PEM -out ca.crt
-
Trust the certificate into CA:
sudo trust anchor ca.crt
-
Run the
mitmproxy
again
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
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0-modified | 20110126 | |
License: none (public domain) | |
*/ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, |
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
On why stateful code is bad | |
=========================== | |
STUDENT: Sir, can I ask a question? | |
TEACHER: Yes! | |
STUDENT: How do you put an elephant inside a fridge? | |
TEACHER: I don't know. | |
STUDENT: It's easy, you just open the fridge and put it in. I have another question! | |
TEACHER: Ok, ask. | |
STUDENT: How to put a donkey inside the fridge? |
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 imp | |
import importlib | |
import inspect | |
import glob | |
import requests | |
import os | |
def import_from_string(content, module_name, file_name=None): | |
if not file_name: | |
file_name = '{0}.py'.format(module_name) |
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
// for more info about ReDoS, see: | |
// https://en.wikipedia.org/wiki/ReDoS | |
var r = /([a-z]+)+$/ | |
var s = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaa!' | |
console.log('Running regular expression... please wait') | |
console.time('benchmark') | |
r.test(s) |
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
String.prototype.replaceAll = function(search, replacement) { | |
var target = this; | |
return target.replace(new RegExp(search, 'g'), replacement); | |
}; | |
String.prototype.toPersianCharacter = function () { | |
var string = this; | |
var obj = { | |
'ك' :'ک', | |
'دِ': 'د', |
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
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |
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 [ | |
{ name: 'Afghanistan', code: 'AF', name_fa: 'افغانستان' }, | |
{ name: 'land Islands', code: 'AX', name_fa: 'جزایر الند' }, | |
{ name: 'Albania', code: 'AL', name_fa: 'آلبانی' }, | |
{ name: 'Algeria', code: 'DZ', name_fa: 'الجزایر' }, | |
{ name: 'American Samoa', code: 'AS', name_fa: 'ساموآی آمریکا' }, | |
{ name: 'AndorrA', code: 'AD', name_fa: 'آندورا' }, | |
{ name: 'Angola', code: 'AO', name_fa: 'آنگولا' }, | |
{ name: 'Anguilla', code: 'AI', name_fa: 'آنگویلا' }, | |
{ name: 'Antigua and Barbuda', code: 'AG', name_fa: 'آنتیگوآ و باربودا' }, |
You can store the TS compiler configuration in the file called tsconfig.json
. You’ll usually add this file to the root directory of your project, together with the package.json
.
When you launch the compiler, it reads the tsconfig.json
from the folder you launched it from, to get the instructions about how to compile your project (e.g., which source files to compile, where to store the output, etc).
The compiler reads the tsconfig.json
from the folder where you run it. Also, you can tell the compiler where to look for the config using the -p
option:
tsc -p tsconfig.server.json
The structure of the tsconfig.json
looks like this:
OlderNewer