Skip to content

Instantly share code, notes, and snippets.

View aeppert's full-sized avatar

Aaron Eppert aeppert

View GitHub Profile
@aeppert
aeppert / gist:1fda3505ea2376547e49
Created July 17, 2015 14:30
Access Class Name Internally.
#!/usr/bin/python
class testing:
def __init__(self):
pass
def get_name(self):
return self.__class__.__name__
t = testing()
print 't\'s class name is - \"%s\"' % (t.get_name())
@aeppert
aeppert / gist:00b1c97009a21c8eabe7
Created July 6, 2015 14:49
Build central to the root directory of the current Git repository
ROOTDIR=$(shell git rev-parse --show-toplevel)
@aeppert
aeppert / gist:b57cb541d0a290837bf2
Last active August 29, 2015 14:24
Template for string conversion with padding and prefix facility
#include <iostream>
#include <sstream>
#include <string>
#include <limits>
using namespace std;
template <class T> std::string to_string(T t, ios_base & (*f)(ios_base&), std::string prefix = "", bool pad = true)
{
std::ostringstream oss;
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
#!/usr/bin/osascript
-- Author: David Koppstein
-- Version 1.0
-- A script for backing up named Calendars from iCal using the GUI interface. Currently,
-- it relies on the fact that exported calendars go to a default directory. Future versions,
-- if they ever come out, will hopefully take care of this issue. Furthermore, this program
-- also assumes that there is already a backed-up .ics file of the same name in that directory.
--
-- While the script is running, be sure not to click anything.
--