Skip to content

Instantly share code, notes, and snippets.

View erinxocon's full-sized avatar

Erin O'Connell erinxocon

View GitHub Profile
MIT License
Copyright (c) 2018 Erin O'Connell
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
MIT License
Copyright (c) 2018 Erin O'Connell
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@erinxocon
erinxocon / macOS_domain.xml
Created August 19, 2017 20:26
Unraid KVM/QEMU Domain config for macOS Sierra/el Capitan for Kabby Lake processors
<domain type='kvm' id='24' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>macOS Sierra</name>
<uuid>bd5ac14f-047f-cf59-5b83-bd63286efa4b</uuid>
<metadata>
<vmtemplate xmlns="unraid" name="Linux" icon="linux.png" os="linux"/>
</metadata>
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<memoryBacking>
<nosharepages/>
@erinxocon
erinxocon / strings.py
Created July 6, 2017 06:00
A small directory walker that uses delegator.py to clean up some binary files
import os
import delegator
rootdir = '.'
for dirName, subdirlist, fileList in os.walk(rootdir):
print('Found Directory: {0}'.format(dirName))
for name in fileList:
if name.lower().endswith('.job'):
from twilio.rest import Client
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8", 80))
ip = s.getsockname()[0]
s.close()
py26 create: /Users/erin.oconnell/repos/requests/.tox/py26
GLOB sdist-make: /Users/erin.oconnell/repos/requests/setup.py
py27 create: /Users/erin.oconnell/repos/requests/.tox/py27
py33 create: /Users/erin.oconnell/repos/requests/.tox/py33
ERROR: InterpreterNotFound: python3.3
py34 create: /Users/erin.oconnell/repos/requests/.tox/py34
ERROR: InterpreterNotFound: python3.4
py35 create: /Users/erin.oconnell/repos/requests/.tox/py35
py36 create: /Users/erin.oconnell/repos/requests/.tox/py36
ERROR: InterpreterNotFound: python3.6
@erinxocon
erinxocon / Pipfile.lock
Last active May 27, 2017 17:36
Requests with and without deps
{
"_meta": {
"hash": {
"sha256": "da2810af0c3b5333e0de2fce9bea2a228812e2014e5f5fe3b1c533badc6c24e4"
},
"requires": {},
"sources": [
{
"url": "https://pypi.python.org/simple",
"verify_ssl": true
using System;
using Nancy.Hosting.Self;
namespace Nancy.Demo.Hosting.Self
{
class Program
{
private string _url = "http://localhost";
private int _port = 12345;
import speech_recognition as sr
import tpfd
p = tpfd.Parser()
@p.on_recognize('{Play} song')
def main(kwargs):
print(kwargs.get('play'))
# obtain audio from the microphone
public class FixedSizedLinkedList<T> : LinkedList<T>
{
private readonly object syncObject = new object();
public int Size { get; private set; }
public FixedSizedLinkedList(int size)
{
Size = size;
}