Skip to content

Instantly share code, notes, and snippets.

@AaronGhent
AaronGhent / exacttarget.py
Created August 22, 2012 23:27
ExactTarget API
# >><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><< #
# ExactTarget API
# Author: Aaron Ghent
# Libraries Needed: suds
# CLI Install: ( pip install suds )
# >><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><< #
from django.conf import settings
from suds.client import Client
@AaronGhent
AaronGhent / ssh.py
Created August 22, 2012 23:52
SSH - Python
#! /usr/bin/env python
# >><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><< #
# ssh - simple ssh2 wrapper
# Author: Aaron Ghent
# >><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><< #
#
# import ssh
# client = ssh.Connection(host='example.com', username='root', password='default')
# client.execute('ls')
# client.close()
@AaronGhent
AaronGhent / spinner.py
Created August 23, 2012 00:00
Spinner
#! /usr/bin/env python
# >><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><< #
# Spinner - command line spinning for times of patience
# Author: Aaron Ghent
# >><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><< #
import sys
class Spinner(object):
symbols = list('-\|/')
@AaronGhent
AaronGhent / linkdump.py
Created August 23, 2012 00:03
LinkDump
#! /usr/bin/env python
# >><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><< #
# linkdump - crawls a site and generates a list of links
# Author: Aaron Ghent
# >><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><< #
import os
import re
import sys
import urllib2
@AaronGhent
AaronGhent / sync_models.py
Created October 26, 2012 02:29
Sync Django Models Properly
# >><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><< #
# Sync's models against database
# >><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><< #
from cStringIO import StringIO
import sys
import re
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
@AaronGhent
AaronGhent / embedded_records_mixin.js
Last active December 30, 2015 05:19
Embedded Objects Mixin Works with the RESTSerializer
var get = Ember.get;
var forEach = Ember.EnumerableUtils.forEach;
/**
The EmbeddedRecordsMixin allows you to add embedded record support to your
serializers.
To set up embedded records, you include the mixin into the serializer and then
define your embedded relations.
```js
@AaronGhent
AaronGhent / p4merge install
Created January 17, 2014 01:02
Installs p4merge on a linux based machine
# p4merge for 64 bit
wget http://www.perforce.com/downloads/perforce/r13.4/bin.linux26x86_64/p4v.tgz
# p4merge for 32 bit
# wget http://www.perforce.com/downloads/perforce/r13.4/bin.linux26x86/p4v.tgz
tar zxvf p4v.tgz
sudo cp -r p4v-* /usr/local/p4v/
sudo ln -s /usr/local/p4v/bin/p4merge /usr/local/bin/p4merge
@AaronGhent
AaronGhent / p4merge mercurial intergration
Last active January 3, 2016 12:59
p4merge mercurial intergration
[ui]
merge = p4merge
[extensions]
hgext.extdiff =
[extdiff]
cmd.p4diff = p4merge
[tortoisehg]
/**
* @name: Modal Mixin
* @framework: Ember.JS
* @author: Aaron Ghent
*/
App.ModalMixin = Ember.Mixin.create({
defaultModal: 'modal',
modalsOpen: {},
actions: {
@AaronGhent
AaronGhent / EmberArrayAsync.js
Last active August 29, 2015 14:04
EmberArrayAsync.js
/**
* @main EmberArrayAsync
*/
/**
* forEachAsync iterates over a large array gradually. The function
* will process items in the array for a given number of ms, stop iterating for
* a given wait time, then proceed and wait until the iteration is complete.
*
* @method forEachAsync