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
3294 | BabyCare Chamomile Baby wipes | 72 pcs | 2.92 | |
---|---|---|---|---|
2812 | Babylino Sensitive Diapers No6 (13-18 Kg) | 40 pcs | 15.6 | |
3406 | Babylino Sensitive Diapers No5+ (13-27 Kg) | 42 pcs | 15.6 | |
3527 | Babylino Sensitive Diapers No5 (11-25 Kg) | 44 pcs | 15.6 | |
2602 | Babylino Sensitive Diapers No4+ (9-20 Kg) | 46 pcs | 15.6 | |
3699 | Babylino Sensitive Diapers No4 (7-18 Kg) | 50 pcs | 15.6 | |
3055 | Babylino Sensitive Pants Diapers No5 (10-16 Kg) | 46 pcs | 21.8 | |
3074 | Babylino Sensitive Pants Diapers No5 (10-16 Kg) | 38 pcs | 15.6 | |
2629 | Babylino Sensitive Pants Diapers No6 (15+ Kg) | 42 pcs | 21.8 | |
2896 | Babylino Sensitive Diapers No3 (4-9 Kg) | 56 pcs | 15.6 |
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
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
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
# assuming Model is your model and options is a json/jsonb column. | |
# This uses the Postgres json append || operator. | |
# And wraps the option inside an array. | |
# producing [{},{}] multiple hashes inside a top level json array. | |
# It is very important that the hash is [{}] NOT {} as not having the array on the | |
# outside will cause the hash to replace the contents instead of appending to them. | |
new_option = [{ | |
name: option_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
{ | |
"blekinge": [ | |
"Blekinge", | |
{ | |
"name": "Karlshamn", | |
"slug": "karlshamn" | |
}, | |
{ | |
"name": "Karlskrona", | |
"slug": "karlskrona" |
This gist will collects all issues we solved with Rails 5.2 and Webpacker
# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test
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
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") |
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 Book < Airrecord::Table | |
class Endorser < Airrecord::Table | |
self.base_key = "" | |
self.table_name = "Endorser" | |
end | |
self.base_key = "" | |
self.table_name = "Books" | |
has_many :endorsements, class: 'Book::Endorser', column: 'Endorsements' |
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
docker inspect --format='{{.LogPath}}' NAME|ID | |
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty | |
echo "" > /var/lib/docker/containers/CONTAINER_ID/CONTAINER_ID-json.log |
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
// PhantomJS Cheatsheet | |
$ brew update && brew install phantomjs // install PhantomJS with brew | |
phantom.exit(); | |
var page = require('webpage').create(); | |
page.open('http://example.com', function() {}); | |
page.evaluate(function() { return document.title; }); |
NewerOlder