Skip to content

Instantly share code, notes, and snippets.

View Ryanb58's full-sized avatar

Taylor Brazelton Ryanb58

View GitHub Profile
@Ryanb58
Ryanb58 / what_architecture.bat
Created March 29, 2016 13:32
Figure out the architecture of your processor via the command prompt on windows.
if /i "%processor_architecture%"=="x86" (
IF NOT DEFINED PROCESSOR_ARCHITEW6432 (
echo Run 32 bit command
) ELSE (
echo Run 64 bit command 1
)
) else (
echo Run 64 bit command 2
)
@Ryanb58
Ryanb58 / polymorphism_example.py
Last active April 8, 2016 18:45
Starter example of polymorphism using python.
# Base Vehicle:
class Vehicle:
# Constructor
def __init__(self, owner):
self.owner = owner
def get_owner(self):
return self.owner
# Methods in which every subclass will be required to implement.
@Ryanb58
Ryanb58 / delayedinterrupt.py
Created April 20, 2016 22:58 — forked from tcwalther/delayedinterrupt.py
DelayedInterrupt class - delaying the handling of process signals in Python
import signal
import logging
# class based on: http://stackoverflow.com/a/21919644/487556
class DelayedInterrupt(object):
def __init__(self, signals):
if not isinstance(signals, list) and not isinstance(signals, tuple):
signals = [signals]
self.sigs = signals
@Ryanb58
Ryanb58 / get_function_names_from_file.py
Created July 8, 2016 00:07
Grab only the names of functions defined in a python file.
import othermodule, types
function_names = [othermodule.__dict__.get(a).__name__ for a in dir(othermodule) if isinstance(othermodule.__dict__.get(a), types.FunctionType)]
for item in items:
print "from ... import " + item

Keybase proof

I hereby claim:

  • I am ryanb58 on github.
  • I am ryanb58 (https://keybase.io/ryanb58) on keybase.
  • I have a public key ASBWzKdm8QwSV0rBOy-yc6Ml3apXU36BUHJgp3019cjnAwo

To claim this, I am signing this object:

@Ryanb58
Ryanb58 / serve_file_via_webdav.sh
Last active October 11, 2016 13:58
Serve up folder via webdav or a webbrowser from local machine.
# Setup folder to be browseable via webdav or a webbrowser.
pip install cherrypy
pip install wsgidav
wsgidav --host=0.0.0.0 --port=8000 --root=/home/ryanb58/Documents
@Ryanb58
Ryanb58 / todo-tutorials.md
Last active November 4, 2016 15:15
List of tutorials I want to go through and concepts I want to learn.
Author: David Lund
IdentTypes
----
ID Desc DataType
1 First Name Char
2 Last Name Char
3 SSN Char
4 StateId Int
5 Foo
@Ryanb58
Ryanb58 / Javascript_Snippets.md
Created February 16, 2017 16:28
Snippets I create that help me with Javascript

Remove text from the end of a String.

function removeFromEnd(original, textToRemove){
	return original.substring(0, original.length - textToRemove.length);
}
@Ryanb58
Ryanb58 / gist:a01ee640ba510de5044e2f664ced6c2c
Created March 20, 2017 18:38
cool_docker_containers.md

Portainer

UI for managing containers.

docker run -d -v "/var/run/docker.sock:/var/run/docker.sock" -p 9000:9000 portainer/portainer