Skip to content

Instantly share code, notes, and snippets.

View serhii73's full-sized avatar
🇺🇦

Serhii A serhii73

🇺🇦
View GitHub Profile
@serhii73
serhii73 / scrapy shell
Created June 7, 2017 07:09
scrapy shell and user-agent
from scrapy import Request
req = Request("url.com", headers={"USER-AGENT" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 OPR/45.0.2552.888"})
fetch(req)

Keybase proof

I hereby claim:

  • I am serhii73 on github.
  • I am serhii73 (https://keybase.io/serhii73) on keybase.
  • I have a public key ASDJeTMHdYR8rJNrX8yOMS8nALk8tO4DHVJD4gXam_2dwwo

To claim this, I am signing this object:

fetch(url).then(resp => resp.json()).then(jsonResult => { // Do some magic })
body{
color: red;
}
git log --grep="--cert"
git grep -e "client-cert"
git blame src/pip/_internal/cli/cmdoptions.py -L 289,+8
@serhii73
serhii73 / gist:12e9a847ef1c02a4d808748ad510c833
Created July 19, 2019 08:16 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@serhii73
serhii73 / click.md
Last active July 16, 2019 08:22
click-example
$ python cli.py London
The weather in London right now: light intensity drizzle.
@click.command()
@click.argument('location')
def main(location):
 weather = current_weather(location)
@serhii73
serhii73 / dispatch.py
Created July 13, 2019 19:53
Dicts can be used to emulate switch/case statements
def dispatch_if(operator, x, y):
if operator == 'add':
return x + y
elif operator == 'sub':
return x - y
elif operator == 'mul':
return x * y
elif operator == 'div':
return x / y
else: