- Connect an iOS defice with a cable
- In QuickTime Player: Option-Cmd-N (New Movie Recording) -> Select your device from the recording menu:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## within current branch, squashes all commits that are ahead of master down into one | |
## useful if you merged with upstream in the middle of your commits (rebase could get very ugly if this is the case) | |
## commit any working changes on branch "mybranchname", then... | |
git checkout master | |
git checkout -b mybranchname_temp | |
git merge --squash mybranchname | |
git commit -am "Message describing all squashed commits" | |
git branch -m mybranchname mybranchname_unsquashed | |
git branch -m mybranchname |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The crmID is predominantly used to fetch a person in `people_service` by looking by via the crmID. | |
compass.com/contacts/subscribers/newperson/handlers/process_invite.go:169 uses crmID to fetch a person. This call can be | |
avoided if `contactually.UserInvite` can return the users `external_id` from c10y. | |
src/go/compass.com/people/server/people.go:359 #GetPersonByCRMID method should be deprecated and a new a similar | |
method which queries based on personID should be used. | |
The existing `get /person` call could be used, but that endpoint seems to be doing a lot of other work. | |
Bulk of the usage of crmID happens in the `src/go/compass.com/people/api/agent.go` file which is used to create/update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gem "ruby-prof" | |
around_filter :profiler | |
def profiler(&block) | |
data = RubyProf::Profile.profile(&block) | |
filepath = Rails.root.join("tmp", "profiler.html") | |
File.open(filepath, "w") do |f| | |
RubyProf::CallStackPrinter.new(data).print(f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def level_up(arr, init=[]) | |
arr.each do |elm| | |
if elm.class == Array | |
level_up(elm, init) | |
else | |
init << elm | |
end | |
end | |
init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ConvertImagesToPaperclip < ActiveRecord::Migration | |
include PaperclipMigrations | |
def self.up | |
# Paperclip | |
add_column :images, :data_file_name, :string | |
add_column :images, :data_content_type, :string | |
add_column :images, :data_file_size, :integer | |
add_column :images, :data_updated_at, :datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# creating a bucket | |
s3 = Aws::S3:Client.new(region: 'us-west-1') | |
s3.create_bucket(bucket: 'bucket-name') | |
#bucket can also be created as | |
s3 = Aws::S3::Resource.new | |
s3.create_bucket(bucket: 'xxxx') | |
#check if a bucket exists? | |
s3 = Aws::S3::Resource.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# creating a bucket | |
s3 = Aws::S3:Client.new(region: 'us-west-1') | |
s3.create_bucket(bucket: 'bucket-name') | |
#bucket can also be created as | |
s3 = Aws::S3::Resource.new | |
s3.create_bucket(bucket: 'xxxx') | |
#check if a bucket exists? | |
s3 = Aws::S3::Resource.new | |
s3.bucket('lp-internal-sarath-test').exists? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Upgrade Postgres 9.4 | |
Ubuntu 12.04 (precise) does not have postgresql-9.4 distribution. We will need to use PostgreSQL APT repository to update. | |
More info here: http://www.postgresql.org/download/linux/ubuntu/ | |
sudo apt-get install postgresql-9.4 | |
sudo apt-get install postgresql-contrib-9.4 (for hstore extensions) | |
pg_lsclusters show now list two existing clusters 9.3 and 9.4 | |
Version Cluster Port Status Owner Data directory | |
9.3 main 5433 down postgres /var/lib/postgresql/9.3/main |