Skip to content

Instantly share code, notes, and snippets.

{
"title": "Find info for these 50 companies",
"line_id": 23453453,
"order": {"amount": 23454, "service_charge": 2342},
"stations": [
{ "station_id": 312,
"units": [
{"results": [{"task_id": "234s324sdff", "ceo": "56Steve Jobs", "email": "info@apple.com"}]},
{"results": [{"task_id": "sdfwewer324324", "ceo": "56Steve Balmer", "email": "info@microsoft.com"}]},
{"results": [{"task_id": "sdf234324", "ceo": "5Larry Page", "email": "info@google.com"}]}
# RAILS APP / PHP APP, ETC
# RUBY GEM / PHP LIBRARY / JAVA LIBRARY, ETC
# REST API
# PLATFORM + ASSEMBLY LINES
# Build the assembly line
# Each AssemblyLine has 1 or more Stations
# Each Station has at least one HumanWorker or 1 RobotWorker
# BASIC
{
"first_name": "Bob",
"middle_name": "",
"last_name": "Morkel",
"maiden_name": "",
"dob": 1974-01-21,
"gender": "Male",
"phone": "111-23-4456",
"primary_email": "bob@bobm.com",
when "email"
regex = /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
when "url"
regex = /^(http:\/\/|https:\/\/)?(www.)?[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3})([.]?[a-zA-Z]{2})?(\/\S*)?$/i
when "number"
regex = /^\d{1,3}(\,?\d{3})*$/
when "time"
regex = /^(([0-1]?[0-9])|([2][0-3])):([0-5]?[0-9])(:([0-5]?[0-9]))?$/
when "date"
regex = /^(\d{1,2})[\/|-|\.|\s](\d{1,2})[\/|-|\.|\s](\d{2,4})$/
## Unit document transformed after geting the result back from Mturk worker
{
"_id": "dsk93kddjfj39o3",
"run_id": 234,
"values":[
{ # Production Run Input
"_id": "23451sdkfj23fdsdfff",
"station_id": nil,
"results": [{"company": "Apple", "website": "http://www.apple.com"}]
},
<!DOCTYPE html>
<html>
<head>
<title>Employees23</title>
<%= stylesheet_link_tag 'jquery-ui-1.8.5.custom','scaffold' %>
<%= javascript_include_tag 'jquery-1.4.2.min','jquery.rails','jquery-ui-1.8.5.custom.min' %>
<link rel="stylesheet" href="../../stylesheets/style.css" type="text/css" />
<%= csrf_meta_tag %>
</head>
<body>
## Employee.rb
def self.upcoming_events
events = Employee.find(:all, :conditions => ["dob is not null"]).sort_by(&:next_birthday).first(10).map{|e|[e, e.dob, "birthday"] }
events += Employment.find(:all, :conditions => ["joined_date is not null"]).sort_by(&:next_probation_expiration).first(10).map{|e| [e.employee, e.joined_date+90.days, "probation"] }
events += PerformanceReview.find(:all, :conditions => ["rev_to is not null"]).sort_by(&:next_review).first(10).map{|p|[p.employee,p.rev_to+6.months, "review"] }
# employee with no performance_reviews
emp_ids = Employee.all.map(&:id) - PerformanceReview.all.map(&:employee_id)
@new_employments = []
@bikashp
bikashp / CSS
Created March 1, 2011 06:23
bizcard custom form
<style type="text/css">
body {background:#fbfbfb;}
#image-field-wrapper{
float-left;
min-width:1050px;
overflow:hidden;
}
#image-panel{

ssh <computer_name or ip> echo $PATH /usr/bin:/bin:/usr/sbin:/sbin

This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

Edit the /etc/sshd_config file by activating the PermitUserEnvironment yes option and then creating a ~/.ssh/environment file with the following:-

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin