Skip to content

Instantly share code, notes, and snippets.

View Lackoftactics's full-sized avatar

Przemyslaw Mroczek Lackoftactics

  • Warsaw, Poland
  • 03:07 (UTC +02:00)
View GitHub Profile
@Lackoftactics
Lackoftactics / CurrentWeather.vue
Last active February 24, 2019 21:43
Code review part I
<div class="row">
{{ $t("WIND") }}:
{{
** This ternary operator looks weird here, logic should be probably moved to function **
getWindDirection(weather.wind ? weather.wind.direction : 400)
}}
| {{ weather.wind ? weather.wind.speed : "n/a" }}m/s
</div>
@Lackoftactics
Lackoftactics / marketing.sql
Created May 21, 2019 09:52
Marketing populate
do $$
begin
for i in 1..10 loop
INSERT INTO public.providers (name, description, address, online_booking, cancellation_policy, cancellation_time, website, contact_numbers, currency_code, country_code, time_zone, created_at, updated_at, print_receipts, receipt_message, prices_include_tax, beginning_of_week, default_calendar_view, time_slot_minutes, sms_enabled, business_type_id, widget_allows_employee_selection, widget_max_advance_time_in_months, commission_before_discount, commission_after_tax, time_format, voucher_expiration_period, locale, payments_activated, marketplace_enabled, marketplace_info, checkout_version, sale_custom_header_1, sale_custom_header_2, sale_show_customer_info, new_appointment_modal, new_appointment_summary, advance_notice_time_in_seconds, appointment_color_source, custom_invoice_title, payments_coming_soon, payments_enabled, new_taxes, sale_show_customer_address, zendesk_enabled, payments_enabled_by_provider, hidden_from_marketplace, payments_required, payment_due, new_cal
EXPLAIN SELECT "customers".*,
coalesce("customer_bookings"."appointments", 0) AS "appointments",
coalesce("customer_bookings"."no_shows", 0) AS "no_shows",
"customer_bookings"."last_appointment" AS "last_appointment",
coalesce("customer_sales"."total_sales", 0) AS "total_sales",
greatest("customer_payments_accumulators"."unpaid_amount", 0) AS "outstanding",
"locations"."name" AS "last_location"
FROM "customers"
LEFT OUTER JOIN
(SELECT COUNT(*) FILTER(
#!/bin/sh
# Script to update YouTube IP ranges and set up routing
# Create YouTube domains file if it doesn't exist
if [ ! -f /config/youtube_domains.txt ]; then
cat > /config/youtube_domains.txt << EOF
youtube.com
youtu.be
ytimg.com
yt3.ggpht.com