This file contains hidden or 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/bash | |
# Repathing .dylib's references for packaging within an application | |
# Author: Roberto Aguilar <[email protected]> | |
# | |
# With help from Nick Jensen's blog at: | |
# http://goto11.net/how-to-bundle-a-c-library-with-a-cocoa-application/ | |
# | |
# All references within the dylib except ones to files in /usr/lib are | |
# converted over to reference the given root. |
This file contains hidden or 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/bash | |
# | |
# Helper functions around "git stash" | |
# | |
# Use this file by sourcing it into your shell environment. For example: | |
# | |
# source /path/to/gstash.sh | |
# | |
# Once sourced in you can run the commands: | |
# |
This file contains hidden or 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
import calendar | |
from iso8601 import parse_date | |
def iso2unix(timestamp): | |
""" | |
Convert a UTC timestamp formatted in ISO 8601 into a UNIX timestamp | |
""" | |
# use iso8601.parse_date to convert the timestamp into a datetime object. |
This file contains hidden or 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) 2004-2008, Roberto Aguilar <berto at chamaco dot org> | |
# All rights reserved. | |
# | |
# Redistribution and use of this software in source and binary forms, with or | |
# without modification, are permitted provided that the following conditions | |
# are met: | |
# | |
# * Redistributions of source code must retain the above copyright notice, | |
# this list of conditions and the following disclaimer. | |
# |
This file contains hidden or 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
VBOX_MANAGE='/Applications/VirtualBox.app/Contents/MacOS/VBoxManage-amd64' | |
function vautostart() { | |
cat ${HOME}/.vbox_autostart | while read i; do | |
${VBOX_MANAGE} startvm --type=headless $i | |
done; | |
} | |
function _vdo() { | |
buf=$1 |
This file contains hidden or 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
index.html: | |
<div ng-controller="ClickyController"> | |
<a href="#" class="btn btn-primary" ng-click="doSomething()">Click my!</a> | |
</div> | |
js/clicky.js: | |
function ClickyController($scope, $location) { | |
$scope.doSomething = function() { |
This file contains hidden or 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 | |
def foo(l=[]): | |
print l | |
l.append('hi') | |
foo() | |
foo() |
This file contains hidden or 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 khd | |
{ | |
[ -z $1 ] && echo "No line number given" && return -1 | |
sed -i -e "${1}d" ${HOME}/.ssh/known_hosts | |
} |
This file contains hidden or 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 NotebookResource(BackboneJSResource): | |
user = fields.ForeignKey(UserResource, 'user') | |
class Meta: | |
queryset = Notebook.objects.all() | |
authentication = MULTI_AUTH | |
authorization = OwnerAuthorization() | |
# allow to list posts for this notebook |
This file contains hidden or 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
""" | |
Celery tasks that batch a job with many tasks into smaller work sets. | |
The problem I'm attempting to solve is one where a job comprised of many | |
tasks (say 100) will snub out a job comprised of only a few tasks (say 5). It | |
appears as though by default celery will queue up the second job's 5 tasks | |
behind the first job's 100 and it will have to wait until the first job's | |
completion before it even begins. |