Skip to content

Instantly share code, notes, and snippets.

View sirvict0r's full-sized avatar
Focusing

vonWikt0r sirvict0r

Focusing
  • The Universe
  • Alexandria, VA
View GitHub Profile

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
    
  • Go to a specified URL
@sirvict0r
sirvict0r / server.py
Created July 26, 2018 17:16 — forked from aenon/server.py
Python 3 HTTP Server with Basic Authentication
import http.server
import cgi
import base64
import json
from urllib.parse import urlparse, parse_qs
class CustomServerHandler(http.server.BaseHTTPRequestHandler):
def do_HEAD(self):
@sirvict0r
sirvict0r / rest.py
Created July 23, 2018 18:59 — forked from tliron/rest.py
Simple and functional REST server for Python (2.7) using no dependencies beyond the Python standard library.
#!/usr/bin/env python
'''
Simple and functional REST server for Python (2.7) using no dependencies beyond the Python standard library.
Features:
* Map URI patterns using regular expressions
* Map any/all the HTTP VERBS (GET, PUT, DELETE, POST)
* All responses and payloads are converted to/from JSON for you
@sirvict0r
sirvict0r / Base File
Created June 7, 2018 16:39 — forked from singledigit/Base File
Cloudformation Files for Creating a Serverless CICD Pipeline
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Deployment Stack'
Parameters:
GitHubToken:
NoEcho: true
Type: String
Description: Secret. It might look something like 9b189a1654643522561f7b3ebd44a1531a4287af OAuthToken with access to Repo. Go to https://github.com/settings/tokens"
GitHubOwner:
Type: String
Description: GitHub UserName
@sirvict0r
sirvict0r / mock_examples.py
Created June 7, 2018 15:32 — forked from evansde77/mock_examples.py
examples of performing mock.patch actions in three different but equivalent ways
#!/usr/bin/env python
"""
mock examples
"""
import os
import unittest
import mock
import functools
@sirvict0r
sirvict0r / README.md
Created May 9, 2018 22:34 — forked from hofmannsven/README.md
My simply Git Cheatsheet