RUN apt-get update
RUN apt-get install libjemalloc-dev
ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libjemalloc.so"
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
begin | |
file = File.open("/tmp/some_file", "w") | |
file.write("your text") | |
rescue IOError => e | |
#some error occur, dir not writable etc. | |
ensure | |
file.close unless file.nil? | |
end |
Explicitly ORDER BY After GROUP BY By default, the database sorts all 'GROUP BY col1, col2, ...' queries as if you specified 'ORDER BY col1, col2, ...' in the query as well. If a query includes a GROUP BY clause but you want to avoid the overhead of sorting the result, you can suppress sorting by specifying 'ORDER BY NULL'.
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
# How to use sqlite3 | |
``` | |
sqlite3 db/development.sqlite3 | |
``` | |
``` | |
sqlite3 db/development.sqlite3 |
my_string.chars do |c|
puts "%s %3d %02X" % [ c, c.ord, c.ord ]
end
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 stop $(docker ps -a -q) #stop all docker container |
class User < ActiveRecord::Base
def do_something!
self.my_attr = 123
end
def do_another_thing!
my_attr = 456
end
🇺🇸
:en:
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
# classique circle_ci rails test config file | |
version: 2 | |
jobs: | |
build: | |
environment: | |
working_directory: ~/circleci-myapp | |
docker: | |
- image: circleci/ruby:2.5.5-node-browsers | |
steps: | |
- checkout |
Are you doing a array of hashes ? They merge. :/
Unless you as: :json
on the test post
post api_v1_stuff, params: params, as: :json