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 sys | |
class Record(object): | |
__slots__ = () | |
def __init__(self, *args): | |
assert len(self.__slots__) == len(args) | |
for field, value in zip(self.__slots__, args): | |
setattr(self, field, value) |
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 contextlib | |
import OpenSSL.crypto | |
import os | |
import requests | |
import ssl | |
import tempfile | |
@contextlib.contextmanager | |
def pfx_to_pem(pfx_path, pfx_password): | |
''' Decrypts the .pfx file to be used with requests. ''' |
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
# install angular cli | |
sudo npm install -g angular cli | |
# init new application | |
ng new app_name --routing | |
cd app_name | |
ng init app_name | |
# serve your application | |
ng serve |
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
function post_to_url(path, params, method) { | |
method = method || "post"; | |
var form = document.createElement("form"); | |
//Move the submit function to another variable | |
//so that it doesn't get overwritten. | |
form._submit_function_ = form.submit; | |
form.setAttribute("method", method); |