Skip to content

Instantly share code, notes, and snippets.

View sebastian-palma's full-sized avatar

Seb sebastian-palma

View GitHub Profile

Keybase proof

I hereby claim:

  • I am sebastian-palma on github.
  • I am lagartijaseb (https://keybase.io/lagartijaseb) on keybase.
  • I have a public key ASBmZgPLA1uYNO_lseJTDIX34oKC-eUGHCPJLC_EeVvkcQo

To claim this, I am signing this object:

PROMPT="%(?:%{$fg_bold[green]%}➜ ($WEZTERM_PANE):%{$fg_bold[red]%}➜ ) %{$fg[cyan]%}%c%{$reset_color%}"
PROMPT+=' $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
# frozen_string_literal: true
module RuboCop
module Cop
module Custom
# Looks for the require of the rails_helper or spec_helper and raises
# a warning as those files are set to be included through the .rspec
# file.
#
# On auto correction it just deletes those lines.
https://stackoverflow.com/questions/70868159/how-do-i-get-instance-of-a-model-with-highest-value-from-an-operation/70869517?noredirect=1#comment125324396_70869517
Director.create(first_name: "Martin Scorsese", date_of_birth: "17/11/1942", id: 2)
Director.create(first_name: "Michael Bay", date_of_birth: "17/02/1965", id: 3)
Director.create(first_name: "George Lucas", date_of_birth: "14/05/1944", id: 1)
Movie.create(name: "Star Wars: Epizoda IV – Nová naděje", release_date: "25/05/1977", description: "", director_id: 1)
Movie.create(name: "Star Wars: Epizoda III – Pomsta Sithů", release_date: "15/05/2005", description: "", director_id: 1)
Movie.create(name: "Skrytá identita", release_date: "06/10/2006", description: "", director_id: 2)
Movie.create(name: "Mizerové", release_date: "07/04/1995", description: "", director_id: 3)
{"id":"06a4194c4b016917","slug":null,"trashed":false,"description":"","like":false,"likes":0,"publish_level":"private","forks":0,"fork_of":{"id":"17468271a273819d","slug":"visualizing-chess-games","title":"Visualizing chess games","owner":{"id":"9ba5e0b68d3e7972","github_login":"EE2dev","avatar_url":"https://avatars0.githubusercontent.com/u/7562919?v=4","login":"ee2dev","name":"","bio":"","home_url":"https://github.com/EE2dev/","type":"individual"},"version":698},"update_time":"2021-05-21T20:12:48.480Z","publish_time":null,"publish_version":null,"thumbnail":null,"default_thumbnail":null,"roles":["editor","owner"],"sharing":"private","subscription":"comments","edit_unpublished":false,"owner":{"id":"77ad7d1d53486a0d","github_login":"sebastian-palma","avatar_url":"https://avatars.githubusercontent.com/u/11888191?v=4","login":"sebastian-palma","name":"Sebastián","bio":"","home_url":"","type":"individual"},"creator":{"id":"77ad7d1d53486a0d","github_login":"sebastian-palma","avatar_url":"https://avatars.githubuserc
[1] pry(main)> Site.includes(:site_links).where.not(site_links: { active: true })
SQL (0.7ms) SELECT "sites"."id" AS t0_r0, "sites"."name" AS t0_r1, "sites"."created_at" AS t0_r2, "sites"."updated_at" AS t0_r3, "site_links"."id" AS t1_r0, "site_links"."site_id" AS t1_r1, "site_links"."link_id" AS t1_r2, "site_links"."active" AS t1_r3, "site_links"."created_at" AS t1_r4, "site_links"."updated_at" AS t1_r5 FROM "sites" LEFT OUTER JOIN "site_links" ON "site_links"."site_id" = "sites"."id" WHERE "site_links"."active" != $1 [["active", true]]
=> [#<Site:0x0000560ffba92250 id: 1, name: "first", created_at: Sun, 28 Mar 2021 18:46:03.661861000 UTC +00:00, updated_at: Sun, 28 Mar 2021 18:46:03.661861000 UTC +00:00>,
#<Site:0x0000560ffba90428 id: 2, name: "second", created_at: Sun, 28 Mar 2021 18:46:06.263937000 UTC +00:00, updated_at: Sun, 28 Mar 2021 18:46:06.263937000 UTC +00:00>]
[2] pry(main)> Site.includes(:site_links).where.not("site_links.active = true")
Site Load (1.0ms) SELECT "sites".* FROM "sites"
set -x PATH $HOME/.rbenv/bin $PATH
rbenv init - | source
version:1
:debug:sysinfo macOS 10.14 (darwin/18.6.0) arch i386
:debug:sysinfo MacPorts 2.6.3
:debug:sysinfo Xcode none
:debug:sysinfo SDK 10.14
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 10.14
:debug:main Found Dependency: path: /usr/bin filename: git regex: ^git$
:debug:main epoch: in tree: 0 installed: 0
:debug:main sbcl 2.0.6_0 exists in the ports tree
:debug:main sbcl 2.0.6_0 +fancy is the latest installed