Skip to content

Instantly share code, notes, and snippets.

View Magons's full-sized avatar
🎯
Focusing

Ivan Magons

🎯
Focusing
View GitHub Profile
@Magons
Magons / rails-jsonb-queries
Created November 1, 2022 08:50 — forked from mankind/rails-jsonb-queries
Ruby on Rails-5 postgresql-9.6 jsonb queries
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")
@Magons
Magons / ssh_multikeys.md
Created May 3, 2022 18:51 — forked from jmcaldera/ssh_multikeys.md
Multiple SSH Keys macOS

Multiple SSH Keys on same client

Check if you have existing keys by opening the terminal and entering: ssh-add -l OR ls -al ~/.ssh and check for any file called (usually) id_rsa or similar

Identify the host you're using your current key for. You probably added this key to, for example your github or gitlab account. We will use this later on.

If you don't have a config file on ~/.ssh folder, you will need to create one. We'll get back to this later.

@Magons
Magons / woocommerce_integration.md
Last active April 5, 2019 09:53
Describe steps to integrate

Setup

Steps:

  1. inject makeAnOfferData function in js. settings now in json, can we save them in wordpress db through webhook?
<script>
	var makeAnOfferData = (function() {
		var data = {
			product: null,
Привет. У меня спрашивали в основном все что спрашивают везде. Единственное было два сложных вопроса:
1. Описать все что происходит когда грузится страница в браузере. Типа от отправляется запрос на dns, после его обрабатывает веб сервер и тд уже в рельсу
2. Если вдруг появится репорт что медленно работает фронт, то с чего начну деббагинг
Знание React ( работал или нет )
Lambda , proc, block
Service Object - что это и тд