Skip to content

Instantly share code, notes, and snippets.

View ahmdrefat's full-sized avatar
🏗️
I may be slow to respond.

Ahmed R. Hussein ahmdrefat

🏗️
I may be slow to respond.
View GitHub Profile
@ahmdrefat
ahmdrefat / gist:4146208
Created November 26, 2012 02:04 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
<div class="row">
<div class="span4">
<div class="thumbnail">
<img src="<%= current_user.profile_image_url %>" style="float: left;margin: 5px;">
<h3><%= current_user.name %></h3>
<h4><%= current_user.location %></h4>
<br>
<p><%= current_user.description %></p>
</div>
</div>
belongs_to :full_profile
belongs_to :full_profile
belongs_to :user
has_many :educations
has_many :positions
belongs_to :user
<div class="row">
<div class="span4">
<div class="thumbnail">
<img src="<%= @basic_profile.picture_url %>" style="float: left;margin: 5px;">
<h3><%= @basic_profile.formatted_name %></h3>
<h4><%= @basic_profile.headline %></h4>
<br>
<p><%= @basic_profile.summary %></p>
</div>
</div>
def get_educations
educations = Education.find_all_by_full_profile_id(current_user.full_profile.id)
if educations.empty?
client = get_client
educations = client.profile(:fields => [:educations]).educations.all
educations.each do |e|
new_educations = Education.create(
school_name: e.school_name,
field_of_study: e.field_of_study,
start_date: Date.parse("1/#{e.end_date.month ? p.end_date.month : 1}/#{e.end_date.year}"),
def get_positions
positions = Position.find_all_by_full_profile_id(current_user.full_profile.id)
if positions.empty?
client = get_client
positions = client.profile(:fields => [:positions]).positions.all
positions.each do |p|
if p.is_current == "true"
Position.create(
title: p.title,
summary: p.summary,
def get_full_profile
fprofile = FullProfile.find_by_user_id(current_user.id)
if fprofile.nil?
client = get_client
full_profile = client.profile(:fields => [:associations, :honors, :interests])
full_profile = full_profile.to_hash
new_full_profile = FullProfile.new(full_profile)
new_full_profile.user = current_user
new_full_profile.save
new_full_profile