設定内容
# vim /etc/sysctl.conf# 共有メモリの最大サイズ。サーバーの搭載メモリ(1GB)に合わせて変更
kernel.shmmax = 1073741824
| import Unauthorised from './Unauthorised' | |
| export default function() { | |
| return { | |
| response: function(response) { | |
| switch (response.status) { | |
| case 401: return Unauthorised.handle(); | |
| } | |
| return response; |
| (require '[clojure.core.async :as a]) | |
| (def xform (comp (map inc) | |
| (filter even?) | |
| (dedupe) | |
| (flatmap range) | |
| (partition-all 3) | |
| (partition-by #(< (apply + %) 7)) | |
| (flatmap flatten) | |
| (random-sample 1.0) |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(query_start, clock_timestamp()), 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(query_start, clock_timestamp()), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| -- AppleScript -- | |
| -- This example is meant as a simple starting point to show how to get the information in the simplest available way. | |
| -- Keep in mind that when asking for a `return` after another, only the first one will be output. | |
| -- This method is as good as its JXA counterpart. | |
| -- Google Chrome | |
| tell application "Google Chrome" to return title of active tab of front window | |
| tell application "Google Chrome" to return URL of active tab of front window | |
| -- Google Chrome Canary |
| #!/bin/bash | |
| # update apt-get | |
| export DEBIAN_FRONTEND="noninteractive" | |
| sudo apt-get update | |
| # remove previously installed Docker | |
| sudo apt-get remove docker docker-engine docker.io* lxc-docker* | |
| # install dependencies 4 cert |
| <?php | |
| $attributeValues = array( | |
| 'color' => array('Red', 'White', 'Blue'), | |
| 'size' => array(1, 2, 3, 4), | |
| 'fabric' => array('Cloth', 'Silk') | |
| ); | |
| class Cartesian | |
| { |
| import React from 'react'; | |
| const ConditionalWrap = ({condition, wrap, children}) => condition ? wrap(children) : children; | |
| const Header = ({shouldLinkToHome}) => ( | |
| <div> | |
| <ConditionalWrap | |
| condition={shouldLinkToHome} | |
| wrap={children => <a href="/">{children}</a>} | |
| > |
| $gravity_form_id = 6; // gravity form id, or replace {$gravity_form_id} below with this number | |
| add_filter("gform_after_submission_{$gravity_form_id}", 'jdn_set_post_acf_gallery_field', 10, 2); | |
| function jdn_set_post_acf_gallery_field($entry, $form) | |
| { | |
| $gf_images_field_id = 42; // the upload field id | |
| $acf_field_id = 'field_54804833b3067'; // the acf gallery field id | |
| // get post |
# vim /etc/sysctl.conf# 共有メモリの最大サイズ。サーバーの搭載メモリ(1GB)に合わせて変更
kernel.shmmax = 1073741824