Skip to content

Instantly share code, notes, and snippets.

View sebastian-palma's full-sized avatar

Seb sebastian-palma

View GitHub Profile
(ns intrv)
;; max
(apply max '(1 2 3 4 5 5 4 3 2 1 5))
;; min
(apply min '(1 2 3 4 5 5 4 3 2 1 5))
;; mean
(let [arr '(1 2 3 4 5 5 4 3 2 1 5)]

For installing tensorflow-hub using Conda prefer the next way (it installs the 2.0.0 version):

$ conda install -c conda-forge/label/cf201901 tensorflow-hub 
# frozen_string_literal: true
require 'open3'
require 'pry'
module Utils
class GemVerifier
def check_needed_gems
require 'tty-prompt'
rescue LoadError
$ bundle exec rails db:migrate
== 20191101233132 ExtendExecutionDatetimePrecision: migrating =================
-- change_column(:executions, :order_insert_time, :datetime, {:limit=>6})
   -> 0.0912s
== 20191101233132 ExtendExecutionDatetimePrecision: migrated (0.0913s) ========

➜  stack git:(master) ✗ bin/rails db -p
Reading table information for completion of table and column names
asyncapi: 2.0.0
info:
title: Streetlights API
version: '1.0.0'
description: |
The Smartylighting Streetlights API allows you to remotely manage the city lights.
### Check out its awesome features:
* Turn a specific streetlight on/off 🌃

Warming up -------------------------------------- Array#each 45.102k i/100ms Hash::[] 36.133k i/100ms Enumerable#map 38.767k i/100ms Enumerable#each_with_object 42.234k i/100ms Object#tap 42.185k i/100ms Enumerable#to_h 44.715k i/100ms Enumerable#index_by 41.212k i/100ms Calculating -------------------------------------

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
set -x PATH $HOME/.rbenv/bin $PATH
rbenv init - | source
[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"
{"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