Skip to content

Instantly share code, notes, and snippets.

View emperorcezar's full-sized avatar

Adam "Cezar" Jenkins emperorcezar

  • SpotHero
  • Mokena, IL
View GitHub Profile
[Wed, 28 Sep 2011 18:43:08 GMT] [error] [<0.5992.0>] {error_report,<0.32.0>,
{<0.5992.0>,crash_report,
[[{initial_call,{couch_rep_reader,init,['Argument__1']}},
{pid,<0.5992.0>},
{registered_name,[]},
{error_info,{exit,{<0.5989.0>,normal},
[{gen_server,terminate,
@emperorcezar
emperorcezar / Randomwords.py
Created October 13, 2011 19:31
Generate a password using random words from words.txt
import os
import random
class WordGenerator(object):
def __init__(self):
current_directory = os.path.dirname(os.path.abspath( __file__ ))
words_file = open("%s/words.txt" % (current_directory), 'r')
self.words = words_file.readlines()
words_file.close()
@emperorcezar
emperorcezar / test.py
Created November 4, 2011 20:19
Test model insert
from django.contrib.auth.models import Group
group = Group.objects.all()[0]
application = IntranetApplication.objects.create(title = 'Test', groups = [group])
application.save()
@emperorcezar
emperorcezar / default.rb
Created February 5, 2012 21:22
Flourish gist
#
# Cookbook Name:: flourish
# Recipe:: default
#
python_virtualenv "#{node[:flourish_dir]}" do
owner "#{node[:flourish_owner]}"
group "#{node[:flourish_group]}"
action :create
end
#
# Cookbook Name:: website
# Recipe:: default
#
# Copyright 2012, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
include_recipe "mysql"
Downloading/unpacking requests==0.10.1 (from -r requirements/production.txt (line 19))
Running setup.py egg_info for package requests
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/code/mayan/venv/build/requests/setup.py", line 10, in <module>
import requests
File "requests/__init__.py", line 25, in <module>
from . import utils
File "requests/utils.py", line 257
return b"".join(L)
@emperorcezar
emperorcezar / default.rb
Created June 12, 2012 18:47
Django-lms chef recipe
#
# Cookbook Name:: django-lms
# Recipe:: default
#
# Copyright 2012, Illinois Institute of Technology
#
# All rights reserved
packages = ["byobu",
"python-dev",
>>> def a(user, *args, **kwargs):
... print user
...
>>> b = {'user':'stuff'}
>>> a(**b)
stuff
def getnums():
for i in range(0, 101):
print i
yield i
if 4 in getnums():
print('yes')
else:
print('no')
@emperorcezar
emperorcezar / gist:4644435
Created January 26, 2013 20:27
bash function to start development on a project.
startdev() {
# Try installing the requirements
# Only check this directory or the one above it
if [ -e ./requirements.txt ]; then
${VIRTUAL_ENV}/bin/pip install -r ./requirements.txt || true
elif [ -e ../requirements.txt ]; then
${VIRTUAL_ENV}/bin/pip install -r ../requirements.txt || true
fi
MANAGE=`find . -name 'manage.py'`