Skip to content

Instantly share code, notes, and snippets.

@alanthonyc
alanthonyc / .bashrc_auto_virtualnv
Created June 27, 2011 11:30
.bashrc to auto activate a virtualenv
# from kencochrane.net
emacs /opt/django/.bashrc
#
# User specific aliases and functions
has_virtualenv() {
if [ -e .venv ]; then
deactivate >/dev/null 2>&1
source bin/activate
fi
@alanthonyc
alanthonyc / plist_template.m
Created December 5, 2011 19:02
Objective-C Scratchpad - a bunch of random stuff
// read plist
NSString *errorDesc = nil;
NSPropertyListFormat format;
NSString *plistPath;
NSString *rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
plistPath = [rootPath stringByAppendingPathComponent:@"Pexplorer.plist"];
NSString *originalPlistPath;
originalPlistPath = plistPath;
@alanthonyc
alanthonyc / debuglog_macro.h
Created January 11, 2012 02:50
Debug Log Macro for iOS (pulled from zonque's code)
#ifdef ENABLE_DEBUG
#define DebugLog(format, args...) \
NSLog(@"%s, line %d: " format "\n", \
__func__, __LINE__, ## args);
#else
#define DebugLog(format, args...) do {} while(0)
#endif
// sample use
DebugLog("number: %d ; class %p", count, className);
import simplejson
import networkx as nx
#http://mlg.ucd.ie/files/summer/tutorial.pdf
from networkx.algorithms import bipartite
g = nx.Graph()
#need to bring in reutersJournalistList
users=simplejson.loads(reutersJournalistList)
@alanthonyc
alanthonyc / Constants.h
Created May 13, 2012 22:26
Global Header File for Objective-C / iOS
//
// Constants.h
//
// Created by Anthony Castillo on 5/11/12.
//
#ifndef MyApp_Constants_h
#define MyApp_Constants_h
#define ONE_DAY 86400
@alanthonyc
alanthonyc / bootstrap-carousel-snippet
Created January 25, 2013 22:11
sample for bootstrap carousel
@implementation UIView (FindFirstResponder)
- (id)findFirstResponder
{
if (self.isFirstResponder) {
return self;
}
for (UIView *subView in self.subviews) {
id responder = [subView findFirstResponder];
if (responder) return responder;
}

Keybase proof

I hereby claim:

  • I am alanthonyc on github.
  • I am anthonyc (https://keybase.io/anthonyc) on keybase.
  • I have a public key whose fingerprint is 65C0 E92C BBDF DECB 3ACE 75FB DBCC E4CE 34F2 B5E1

To claim this, I am signing this object:

@alanthonyc
alanthonyc / .gitignore
Last active August 29, 2015 14:09 — forked from adamgit/.gitignore
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.3
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fabfile for Django
------------------
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle)
several additions, corrections and customizations, too