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
$ sudo docker ps | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
af8da3cff175 registry:2 "/entrypoint.sh /etc…" 17 minutes ago Up 3 minutes 5000/tcp registry | |
$ sudo docker exec -it registry /bin/sh | |
/ # ps | |
PID USER TIME COMMAND | |
1 root 0:00 registry serve /etc/docker/registry/config.yml | |
14 root 0:00 /bin/sh | |
20 root 0:00 ps |
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
import { Controller } from 'stimulus'; | |
export default class extends Controller { | |
static targets = ['form', 'card', 'errors', 'token', 'submitBtn'] | |
connect() { | |
this.stripe = Stripe(this.key) | |
this.card = this.cardTarget | |
} |
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
select distinct jsonb_object_keys(base_rates::jsonb)::int term | |
from ( | |
select base_rates ->> jsonb_object_keys(base_rates) base_rates | |
from lease_rates where base_rates != '{}' | |
) lease_rates order by term asc |
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
CREATE OR REPLACE FUNCTION valuations_search_trigger() | |
RETURNS trigger AS $$ | |
DECLARE | |
id integer; | |
tsv tsvector; | |
BEGIN | |
new.tsv := subquery.tsv_data from (SELECT to_tsvector(COALESCE(properties.postcode, '')) || | |
to_tsvector(COALESCE(lenders.name, '')) || | |
to_tsvector(COALESCE(brokers.name, '')) || | |
to_tsvector(COALESCE(applicants.name, '')) || |
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 BookingMailer < ApplicationMailer | |
def joining_instructions(booking) | |
@booking = booking | |
@event = booking.try(:event) | |
@venue = @event.venue.try(:decorate) | |
@course = booking.course | |
@person = booking.person | |
@course.attachments.each do |attachment| |
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
SELECT ST_Distance(sy, liv) As sy_spheroid, ST_Distance(sy, liv, false) As sy_sphere, | |
ST_Distance(man, liv) As man_spheroid, ST_Distance(man, liv, false) As man_sphere | |
FROM (SELECT | |
ST_GeogFromText('SRID=4326;POINT(52.7457486 -2.7350538)') As sy, | |
ST_GeogFromText('SRID=4326;POINT(53.4816995 -2.2408938)') As man, | |
ST_GeogFromText('SRID=4326;POINT(53.4059077 -2.979514)') As liv | |
) As foo; |
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
$ rails routes | grep post | grep admin | |
preview_admin_blog_posts POST /admin/blog/posts/preview(.:format) admin/blog/posts#preview | |
admin_blog_posts GET /admin/blog/posts(.:format) admin/blog/posts#index | |
POST /admin/blog/posts(.:format) admin/blog/posts#create | |
new_admin_blog_post GET /admin/blog/posts/new(.:format) admin/blog/posts#new | |
edit_admin_blog_post GET /admin/blog/posts/:id/edit(.:format) admin/blog/posts#edit | |
admin_blog_post GET /admin/blog/posts/:id(.:format) admin/blog/posts#show | |
PATCH /admin/blog/posts/:id(.:format) admin/blog/posts#update | |
PUT /admin/blog/posts/:id(.:format) admin/blog/posts#update | |
DELETE /admin/blog/posts/:id(.:format) admin/blog/posts#destroy |
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
SELECT id, name, contact_name, telephone, | |
email, valuation_types, min_value, max_value, | |
address, lonlat, distance | |
FROM ( | |
SELECT "valuation_firms"."id", "valuation_firms"."name", | |
"valuation_firms"."contact_name", "valuation_firms"."telephone", | |
"valuation_firms"."email", "valuation_firms"."valuation_types", | |
"valuation_firms"."min_value", "valuation_firms"."max_value", | |
"locations"."address", "locations"."lonlat", users.id AS user_id, | |
ST_Distance(lonlat, ST_Point(xxx, xxx)) as distance, dense_rank() |
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
::Blog::Post.table_name | |
=> "posts" |
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
SELECT DISTINCT ON ("name") | |
"name", "id", "created_at", "distance" | |
FROM | |
( | |
SELECT vf.*, ST_Distance(l.lonlat, ST_Point(53.370384, -2.180959)) as distance | |
FROM "valuation_firms" vf | |
INNER JOIN "locations" l ON l."valuation_firm_id" = vf."id" | |
WHERE ST_DWithin(l.lonlat, ST_Point(53.370384, -2.180959), 40233.500000) | |
ORDER BY distance ASC | |
) valuation_firms |
NewerOlder