Skip to content

Instantly share code, notes, and snippets.

View josephmisiti's full-sized avatar

Joseph Misiti josephmisiti

View GitHub Profile
#!/usr/bin/env python
import sys
# input comes from STDIN (standard input)
for line in sys.stdin:
# remove leading and trailing whitespace
line = line.strip()
# split the line into words
words = line.split()
#!/usr/bin/env python
from operator import itemgetter
import sys
current_word = None
current_count = 0
word = None
# input comes from STDIN
#!/bin/sh
#
# This script will exceute the word-count example using Hadoop + Python Streaming
#
hadoop jar /usr/local/Cellar/hadoop/1.0.3/libexec/contrib/streaming/hadoop-*streaming*.jar \
-file /path/to/mapper.py \
-mapper /path/to/mapper.py \
-file /path/to/reducer.py \
-reducer /path/to/reducer.py \
@require_POST
@login_required
@json.json_view
def reject_applicant(request,aid):
applicant = MHRBoxApplicant.objects.get(account_id=str(aid))
reject_reason = request.POST.get('reject_reason',None)
applicant.info['reject_reason'] = reject_reason
@require_POST
@login_required
@json.json_view
def reject_applicant(request,aid):
applicant = MHRBoxApplicant.objects.get(account_id=aid)
applicant.info['reject_reason'] = request.POST['reject_reason']
applicant.status = HRBOX_APPLICANT_STATUS_REJECTED
applicant.save()
@login_required
def employee_create(request, employee_id):
applicant = MHRBoxApplicant.objects.get(account_id=employee_id)
job = MHRBoxJob.objects.get(id=applicant.job.id)
try:
employee = MHRBoxEmployee.objects.get(unique_id=employee_id,job=job)
except MHRBoxEmployee.DoesNotExist:
logging.debug('Created new hrbox employee ~ apps.hrbox.views.employee')
info = {}
info['general'] = {}
for req in range(0,21):
reqname = 'job_required_skill_' + str(req)
if reqname in request.POST:
required_skills.append(request.POST[reqname])
for pref in range(0,21):
prefname = 'job_required_skill_' + str(pref)
if prefname in request.POST:
preferred_skills.append(request.POST[prefname])
job.application['required_skills'] = request.POST.getlist('job_skill')[0:20]
job.application['preferred_skills'] = request.POST.getlist('job_skill')[0:20]
def credit_card(request):
params = {
'STRIPE_PUBLISHABLE' : settings.STRIPE_PUBLISHABLE,
}
c = RequestContext(request)
q_type = request.GET.get('li')
params['q_type'] = q_type
if q_type == 'SEARCH' or q_type == 'REGISTER':
sub_type = request.GET.get('typ')
def credit_card(request):
params = {}
q_type = request.GET.get('li')
params['q_type'] = q_type
if q_type == 'SEARCH' or q_type == 'REGISTER':
params['s_type'] = request.GET.get('typ')
params['STRIPE_PUBLISHABLE'] = settings.STRIPE_PUBLISHABLE
return render_to_response('credit_card.html', params, context_instance=RequestContext(request))