This file contains hidden or 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
production@ec2-server: time bin/rails c | |
exit ( typed while waiting for it to load ) | |
Loading development environment (Rails 4.0.2) | |
irb(main):001:0> exit | |
real 0m11.141s | |
user 0m19.918s | |
sys 0m0.983s |
This file contains hidden or 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
brand new slice as root: | |
One of these... | |
echo "America/New_York" > /etc/timezone | |
sudo dpkg-reconfigure --frontend noninteractive tzdata | |
or | |
sudo timedatectl set-timezone America/New_York |
This file contains hidden or 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
so...he has a branch. his branch has a local and a remote...he was local...and committed several times...then b/c when he pushed it said he couldn't b/c the origin of his branch was behind...because i merged the master into his origin branch so he could have all the updates, but he never pulled them | |
and continued to change his local branch...so his local branch and origin branch were so out of sync they couldn't resolve themselves...so i made him pull the remote of his branch (origin)...which apparently overwrote all of the local commits he had been doing all week | |
then he committed the local branch to get it in sync then pushed to the origin of his branch to make everything even again | |
...now...all those local commits that were overwritten are gone |
This file contains hidden or 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
collection: | |
{ | |
embedded: | |
[ | |
{ | |
collection: | |
{ | |
href: '/stuff/123.json', | |
items: | |
[ |
This file contains hidden or 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
it 'searches by zipcode' do | |
puts "Before this bruhaha, zipcode count is #{Zipcode.count}: #{Zipcode.all.map(&:code)}" | |
needle = Zipcode.where(:code => '90333').first || FactoryGirl.create(:zipcode, code: '90333') | |
puts "in the middle, zipcode count is #{Zipcode.count}: #{Zipcode.all.map(&:code)}" | |
get :search, :format => :json, :code => 90333 | |
assigns(:zipcodes).should have(1).entry | |
assigns(:zipcodes).should include(needle) |
This file contains hidden or 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
/* from item-level link */ | |
{ | |
"collection": { | |
"href": "/characters.json", | |
"embedded": [ | |
{ | |
"collection": { | |
"href": "/characters/the_doctor/actors.json", | |
"items": [ |
This file contains hidden or 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
jw@logopolis:/projects/medycation/api$ curl http://api.server.com:9292/index.json -I -H 'Accept-Encoding: gzip, deflate' | |
HTTP/1.1 200 OK | |
X-Frame-Options: SAMEORIGIN | |
X-XSS-Protection: 1; mode=block | |
X-Content-Type-Options: nosniff | |
X-UA-Compatible: chrome=1 | |
Content-Type: application/json; charset=utf-8 | |
ETag: "34ac3eee261d4ffa245819f3c20387bd" | |
Cache-Control: max-age=0, private, must-revalidate | |
Set-Cookie: request_method=HEAD; path=/ |
This file contains hidden or 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
select count(DISTINCT(appointments.id)) from appointments LEFT JOIN pictures ON pictures.appointment_id = appointments.id LEFT JOIN routes ON appointments.route_id = routes.id WHERE pictures.created_at IS NOT NULL AND DATE(CONVERT_TZ(MIN(pictures.created_at), 'UTC', 'US/Eastern')) != routes.date GROUP BY appointments.id; |
This file contains hidden or 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 UserSearch < Valuable | |
has_value :term | |
has_value :include_inactive, :default => false | |
has_value :postal_code | |
def scope | |
User.apply( conditions ) | |
end | |
def term_like |
This file contains hidden or 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
#! /bin/bash | |
export HOME=/home/jw | |
export RAILS_ENV=development | |
source /usr/local/share/chruby/chruby.sh | |
source /usr/local/share/chruby/auto.sh | |
# there is a .ruby-version under /projects/client/project but I've tried setting it here, too. |