See this issue.
Docker best practise to Control and configure Docker with systemd.
-
Create
daemon.jsonfile in/etc/docker:{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
See this issue.
Docker best practise to Control and configure Docker with systemd.
Create daemon.json file in /etc/docker:
{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| class Integer | |
| N_BYTES = [42].pack('i').size | |
| N_BITS = N_BYTES * 16 | |
| MAX = 2 ** (N_BITS - 2) - 1 | |
| MIN = -MAX - 1 | |
| end | |
| p Integer::MAX #=> 4611686018427387903 | |
| p Integer::MAX.class #=> Fixnum | |
| p (Integer::MAX + 1).class #=> Bignum |
| """ | |
| Defines a function `auto_insert` to help with | |
| `pygit2.Repository.TreeBuilder`s. | |
| Just create the top-level `TreeBuilder`, and it will handle all subtree | |
| creation if you give it paths. | |
| """ | |
| import shutil | |
| from tempfile import mkdtemp |
| { | |
| //given: | |
| const repo - bare Repository {} | |
| const branchCommit = repo.getBranchCommit(branchName), | |
| // actual method: | |
| open: async (fn) => { | |
| const tree = await branchCommit.getTree(); | |
| const treeBuilder = await nodegit.Treebuilder.create(repo, tree); |
This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.
It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.
| class Evacuation < ActiveRecord::Base | |
| def self.notify_person_found | |
| connection.execute "NOTIFY evac, #{connection.quote 'found person'}" | |
| end | |
| def self.on_person_found |
| class Evacuation < ActiveRecord::Base | |
| def self.notify_person_found | |
| connection.execute "NOTIFY evac, #{connection.quote 'found person'}" | |
| end | |
| def self.on_person_found |
| module ActiveRecord | |
| # Allows embedding of ActiveRecord models. | |
| # | |
| # Embedding other ActiveRecord models is a composition of the two | |
| # and leads to the following behaviour: | |
| # | |
| # - Nested attributes are accepted on the parent without the _attributes suffix | |
| # - Mass assignment security allows the embedded attributes | |
| # - Embedded models are destroyed with the parent when not appearing in an update again | |
| # - Embedded documents appears in the JSON output |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |