Skip to content

Instantly share code, notes, and snippets.

Djangoの複数DBを使ったレプリケーション

要約

  • Django標準のDATABASESでDBを定義し、DATABASE_ROUTERSでルーティングを定義したクラスを書けばほぼ行けそう。
  • 3rd-Partyはレプリカ遅延のアプローチを提供しているので、使うならPJに合うものを選定・もしくは自前実装すること。

MySQLのレプリケーションについて

Copyright (c) 2014 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
@voluntas
voluntas / open_momo.rst
Last active August 17, 2024 07:04
OpenMomo プロジェクト
<details>
<summary>押してみそ?</summary>
な?
```pl
use strict;
```
どう?
</details>

詳解 WebRTC

更新:2017-09-26
作者:@voluntas
作者サイト:http://voluntas.github.io/
バージョン:1.2.1
セッション日時:2017-09-24 14:20 - 15:00
セッション場所:5号館3F
@sedm0784
sedm0784 / _vim_auto_list.markdown
Last active May 29, 2023 15:43
Vim Automatic List Continuation

Vim Auto List Completion

This snippet makes Vim automatically continue/end lists in insert mode, similar to the way word processors do:

  • It automatically adds the bullet/number for the next list item when you press Return at the end of an existing item,
  • When you press Return on an empty list item, it removes the bullet/number, ending the list.

It supports ordered lists with markers like 1. and unordered lists with - markers (because those are the markers I use.)

(It's particularly useful when using an iOS keyboard where punctuation and numerals are slow to access.)

@yutori
yutori / redis_cluster.md
Last active April 20, 2019 23:17
Redis Cluster のリシャーディングとorphaned masterの話 - CyberAgent エンジニア Advent Calendar 2014 2日目

Redis Cluster のリシャーディングとorphaned masterの話

(2019/04 追記 こちらの情報は非常に古く、またRC版での結果となります。記録として残していますが参考になさらないでください

CyberAgent エンジニア Advent Calendar 2014 2日目です。

昨日に引き続き、秋葉原ラボの柿島が担当します。仕事ではHadoopクラスタの運用を中心に、秋葉原ラボのインフラ/ミドルウェアまわりを担当しています。今年はHadoop、mesos、Aerospikeと分散型のシステムを触る機会が多い1年でした。

この記事のテーマはRedis Clusterです。Redis Clusterが使えるようになるRedis 3.0.0は10月にRC1がリリースされました。2015年のQ1にstableリリースを目指しているようです。

require 'json'
require 'uri'
require 'net/https'
class Slack
def initialize(settings)
@host = settings["host"]
@endpoint = settings["endpoint"]
@token = settings["token"]
end
def send_message(message, username="kussan-bot", icon_emoji=":kussan:", channel="#develop")

Atomコードリーディングメモ

ビルド方法

script/build

起動したらsrc/window-bootstrap.coffeeが起動時間のログを出してるので、そいつをgrepすると/src/broweser/atom-application.coffee が引っかかる。

src/broweser/atom-application.coffee は、 src/browser/main.coffee に呼ばれている

@aodag
aodag / instoru-paison
Created May 3, 2014 13:57
veriy simple python installer
#!/bin/sh
# -*- mode:sh -*-
version=$1
if [ "x$1" = "x" ] ; then
exit 1
fi
major=$(echo $version | awk -F "." '{print $1}')
minor=$(echo $version | awk -F "." '{print $2}')
micro=$(echo $version | awk -F "." '{print $3}')