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
#!/usr/bin/env python | |
class Missing: | |
pass | |
def diff(instance1, instance2=None, missing_field=None): | |
''' | |
Compares two instances and returns a dictionary of | |
the different fields and a tuple of the corrisponding values. |
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
#!/bin/sh | |
place=".1.3.6.1.4.1.2021.255" | |
refresh() { | |
id=1 | |
lastid=0 | |
noise_reference=$(wl -i `nvram get wl0_ifname` noise | cut -d" " -f3) | |
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! ToggleMinimap() | |
if exists("s:isMini") && s:isMini == 0 | |
let s:isMini = 1 | |
else | |
let s:isMini = 0 | |
end | |
if (s:isMini == 0) |
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
class TempResource(Resource): | |
class Meta: | |
resource_name = 'temp_resource' | |
object_class = temp_resource.delay | |
authorization = Authorization() | |
allowed_methods = ['post', 'get'] | |
always_return_data = True | |
def get_resource_uri(self, bundle_or_obj): | |
""" |
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
--- /Users/jathan/Desktop/trav_xml/before/Phoenix/Components/MainWindow.xml 2011-11-11 10:07:56.000000000 -0800 | |
+++ /Users/jathan/Desktop/trav_xml/new/Phoenix/Components/MainWindow.xml 2012-05-14 14:33:30.000000000 -0700 | |
@@ -182,13 +182,12 @@ | |
</Component> | |
- | |
- <!-- | |
+ <!-- | |
////////////////////////////////////////////// |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
This is a prototype of a simple state machine that remotely executes a list of | |
commands via SSH on network devices (expecting the prompt_pattern to match) and | |
returns the results to you. | |
""" | |
__author__ = 'Jathan McCollum' |
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
# -*- coding: utf-8 -*- | |
""" | |
Simple AES crypto thingy to to encrypt/decrypt passwords. | |
""" | |
from Crypto.Cipher import AES # http://pypi.python.org/pypi/pycrypto | |
DEFAULT_PADDER = '\x03' | |
DEFAULT_KEYLEN = 16 |
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
from functools import wraps | |
framework_namespace = {'api_key':"This is the api_key"} | |
def inject_namespace(fn=None, namespace=None): | |
""" | |
Inject a dictionary into the global namespace of the wrapped function | |
and then clean it up afterward. Hacktastic! | |
Credit: http://stackoverflow.com/a/3910211/194311 |
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
# -*- coding: utf-8 -*_ | |
""" | |
A dictionary-like object to represent items as attributes, but still behaves | |
like a dict in every way. | |
""" | |
__author__ = 'Jathan McCollum' | |
__maintainer__ = 'Jathan McCollum' | |
__email__ = '[email protected]' |
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
# Copyright (c) 2011 Joshua D. Bartlett | |
# | |
# 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: | |
# | |
# The above copyright notice and this permission notice shall be included in |
OlderNewer