Skip to content

Instantly share code, notes, and snippets.

@Epictetus
Epictetus / drop_innodb-result.txt
Created February 14, 2021 14:40 — forked from ochaochaocha3/drop_innodb-result.txt
外部キー制約によってMroongaでDROP DATABASEが失敗する例
Table Create Table
contents CREATE TABLE `contents` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `text` text,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC
Table Create Table
c_refs CREATE TABLE `c_refs` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `content_id` int(11) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `index_c_refs_on_content_id` (`content_id`),\n CONSTRAINT `content_id` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC
@Epictetus
Epictetus / puma.monitrc
Created January 15, 2021 08:29 — forked from sudara/puma.monitrc
Example config needed to use monit with puma, monitoring workers for mem.
# this monit config goes in /etc/monit/conf.d
check process puma_master
with pidfile /data/myapp/current/tmp/puma.pid
start program = "/etc/monit/scripts/puma start"
stop program = "/etc/monit/scripts/puma stop"
group myapp
check process puma_worker_0
with pidfile /data/myapp/current/tmp/puma_worker_0.pid
@Epictetus
Epictetus / LearnGoIn5mins.md
Created January 5, 2021 18:19 — forked from prologic/LearnGoIn5mins.md
Learn Go in ~5mins
@Epictetus
Epictetus / Dockerfile
Created January 1, 2021 04:59 — forked from nagait84/Dockerfile
【メモ】マルチステージビルドを用いたRails用イメージ(開発・本番)
FROM ruby:2.6.3-alpine as base
LABEL maintainer="nagait84 <nagai@hanoi.jp>"
# ビルド時の作業ディレクトリ
WORKDIR /app
# bundler インストールパスの指定
ENV BUNDLE_APP_CONFIG /app/.bundle
# Railsのログは標準出力に流す
@Epictetus
Epictetus / gist:2f26f93327ee40dfa5ffd88be56c843b
Created December 6, 2020 09:07 — forked from steipete/ios-xcode-device-support.sh
Using iOS 14 devices with Xcode 11.5 (instead of Xcode 12)
// The trick is to link the DeviceSupport folder from the beta to the stable version.
// sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
// Support iOS 14 devices (Xcode 12.0) with Xcode 11.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/14.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
// Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions

scoutyからのスカウトメールをオプトアウトする方法

株式会社scouty(スカウティ) | 日本初のAIヘッドハンティングサービスから送信されるスカウトメールのオプトアウト手順についてまとめました。

2018年6月ごろの情報にもとづく内容です。

0. スカウトメールを受信する

[scouty][]からのスカウトメールはGitHubなどのウェブサイトをクロールした情報を元に送信されます。 そのため、scoutyのサイトに登録していない場合でもscoutyからのスカウトメールが送信されます。

@Epictetus
Epictetus / vim-on-heroku.sh
Created May 2, 2017 06:16 — forked from sfate/vim-on-heroku.sh
vim on heroku
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin

@ITやテッククランチがアホすぎてつらい。

要約

Rap GeniusというサービスがHerokuに月額2万ドル払っていて、そのサービスに満足していたという。 内訳はよくわからないが、Herokuの「サクセスストーリー」に公開されているところによると、彼らはWeb用のdynoを120使っているとのこと。 http://success.heroku.com/rapgenius

New Relic(サードパーティのパフォーマンス計測アドオン)には年間 $63116.13 払っているという。

# Tested on DelayedJob 2.1
class MyRecurringDelayedJob
def perform
# ...some slow code
end
def success(job)
MyRecurringDelayedJob.schedule_job(job)
end
require 'socket'
ETH_P_ALL = 0x0300
ETH_P_IP = 0x800
class MacAddr
def initialize(addr)
@addr = addr
end