Skip to content

Instantly share code, notes, and snippets.

@at1as
at1as / gist:f3eecf2c71bfa02e14d5
Created June 1, 2015 14:31
Publishing Gems & Python Packages
*PyPi Package*
Structure:
├── LICENSE.md
├── README.md
├── hello_world
│   ├── __init__.py
│   ├── hello_world.py
├── hello_world_runner.py
@at1as
at1as / gist:67db7a5507d4a18e626c
Last active August 29, 2015 14:07
Cipher2.rb
# encoding: UTF-8
# Jason M Willems
# github.com/at1as
# 15 September 2014
# 514-746-0452
require 'Base64'
ENCODED = "pr+/trjGu8vDeXmuw8F9y8TT1MPKyYXP2qKJjL7b2tOP5Nnb4dvolsTZ55ry3fCe7eX35/Wk8uvo9v2q//ut+f3/CMCz2gQIt/0P/w0VEQYIDgjCCBAYC9PIHRIQHhLVItD4ISIbIRvl2tkOMCEwIiA54Ss25CbmLjc4LuswLkfvREDyRkNBTDz4SU9VVklDUg4PEA=="
@at1as
at1as / Ruby_Reference.md
Last active May 6, 2019 01:51
Ruby Reference

A few rough notes I used as a Ruby reference as I was beginning to learn the language.

Object Concepts

Modules

A module is a way to group together methods, classes and constants and is designed to be accessed by many classes. These provide some advantages, one of which is that they are a sandboxed environment, and that they can be accessed by many classes. Modules cannot be instantiated, but are rather extended or included.

Extends versus Includes

@at1as
at1as / Automation Tools and Libraries.md
Last active December 28, 2016 11:11
Test Automation Tools and Librarys

A list of a few useful Automation Tools & Libraries. Each of these have their pros and cons, but a combination of a few of these can give you pretty good test coverage without a lot of effort.

API Testing

Load Test

  • [JS Script] Runs a load test on the selected URL. Easy to extend minimally for your own ends.

API Tester

@at1as
at1as / ruby_random_class_tester.rb
Last active August 29, 2015 14:03
Just how random is Ruby's Random Class?
# How random is Ruby's Random Class?
require 'descriptive_statistics'
def rand_distribution(iters)
found = Hash.new
100.times { |key| found[key.to_s] = 0 }
iters.times do
rand_num = Random.rand(0..99)
found[rand_num.to_s] += 1
@at1as
at1as / create_file_of_size.py
Created June 9, 2014 20:47
create_file_of_size.py
#!/usr/bin/env python
'''
This script will create a file of a specified size
Usage: ./create_file_of_size.py --filename myfile --filesize 2 --magnitude mb
=> File myfile with size 2mb been created
'''
# Dependencies
import math
@at1as
at1as / webServerData.py
Last active January 1, 2016 07:09
Simple python script to extract basic website information (derived from curl request + ping), and display is cleanly. Example output below:Status: HTTP/1.1 200 OK,Server: Apache,Server Time: Mon, 23 Dec 2013 22:00:00 GMT,Actual Time: 2013-12-23 22:00:12.601447,Encoding: UTF-8,Default Path: example.com/Home.html,URL Lowercase: False,Has Favicon: …
#!/bin/bash/env python2.7
from subprocess import Popen, PIPE, STDOUT
import re
import datetime
site = 'example.com' #enter website URL here
favicon = False
ssl_enabled = False
@at1as
at1as / carryOperations.py
Last active December 28, 2015 22:29
Will return the number of carry operations performed when adding two positive numbers
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
'''
Will return the number of carry operations performed in positive integer addition
'''
carryover, carryCount = False, 0
while True: #accept positive integer values as input
try:
@at1as
at1as / simpleSubstitutionCipher.py
Last active December 28, 2015 20:19
A simple substitution cipher with example output. Fixed-length 2 digit keys yield single character defined in dictionary, d.
#!/bin/usr/env python2.7
# -*- coding: utf-8 -*-
d = { '5E': 't', '5D': 'w', '5F': 'u', '5A': 'p', '5C': 'v', '5B': 'q', '48': 'b', '49': 'c', '46': 'l', '47': 'm', '44': 'n', '45': 'o',
'42': 'h', '43': 'i', '40': 'j', '41': 'k', '0A': ' ', '4F': 'e', '4D': 'g', '4E': 'd', '4B': 'a', '6B': 'A', '59': 's', '58': 'r',
'6F': 'E', '50': 'z', '53': 'y', '52': 'x', '6D' : 'G', '0B' : '!', '07' : '-', '06' : ',', '27' : '\\', '20' : 'n', '4C' : 'f', '6C' : 'F',
'C7' : 'í', '64' : 'N', 'C1' : 'ë' }
ct = '6B0A6F46484F584F5E420A6D43465E42454443C1462720594346435C584F440A5A4F44444B0A47C75843C1462720450A474F444F460A4B4D464B580A4F464F444B5E420B2720644B0749424B4F584F4E0A5A4B464B44074EC75843C1462720450A4D4B464B4E42584F474743440A4F444445584B5E420627206C4B445F43464559060A464F0A464344444B5E4245442720444F4C0A4B4F4B58060A59C70A444F4C0A4B4F4B5845440B'
@at1as
at1as / factorBranches
Created November 20, 2013 00:22
Given an integer, will return a list of all factor branches from the integer to 1. Range of divisors to use can be set through maxDivisor
Given an integer, will return a list of all factor branches from the integer to 1. Range of divisors to use can be set through maxDivisor
ex. using input 72, and divisors of less than 10:
jason$ python factorBranches.py
Enter a positive integer (large numbers will yield high runtime): 72
[72, 8, 1]
[72, 9, 1]
[72, 12, 2, 1]
[72, 12, 3, 1]