Skip to content

Instantly share code, notes, and snippets.

View zaru's full-sized avatar
😍
write code

zaru zaru

😍
write code
View GitHub Profile
@nilsmehlhorn
nilsmehlhorn / index.js
Last active March 20, 2022 00:31
Firebase Cloud Function: Thumbnail Generator (Serverless)
const { join, dirname } = require('path')
const sharp = require('sharp')
const { Storage } = require('@google-cloud/storage')
const { promisify } = require('util')
const pump = promisify(require('pump'))
const gcs = new Storage()
const SIZE = 128
const PREFIX = 'thumb@'
@szktty
szktty / WebRTCAPIGuide.md
Last active July 22, 2024 08:09
WebRTC ネイティブ iOS ライブラリ API ガイド

WebRTC ネイティブ iOS ライブラリ API ガイド (M62)

Safari が WebRTC に対応したり、 React-Native があったりと、 WebRTC を使う iOS アプリの開発ではネイティブライブラリ (WebRTC.framework) + Swift を使わない選択肢も十分あります。でも最終的に手の込んだことをやろうとすると、もしくは最新のリリースブランチを使うとなると、ネイティブライブラリに頼らざるを得ません。いかんせんネイティブライブラリの情報が少なくて辛いですね。参考になれば辛い、いえ幸いです。

ここで扱うのはメディアチャネルのみです。データチャネルについては扱いません。知りませんので。ビルドについても扱いません。なんとかしてください。

私は主に商用 WebRTC SFU SoraiOS SDK を開発しており、そのため以下の内容が環境に依存してしまっている可能性があります。その場合はご指摘頂けると助かります。

Swift での利用

Deploying Elixir and Phoenix applications using Docker and Exrm

Goal

By the end of this quick guide, you will know how to compile a Phoenix app release using Exrm and run it inside a Docker container. I've found only a couple of articles that discuss getting an Elixir app up and running inside a Docker container, and even those only touched on some parts of the process. The idea is that this guide will give you a full end-to-end example of how to get all the pieces and parts working together so that you are able to deploy your Phoenix application inside a Docker container.

Assumptions

  1. You already have a working Elixir environment with the Phoenix Framework installed
  2. You have at least basic working knowledge of Docker, and have installed the Docker tools onto your local environment
@yymm
yymm / want_to_ergodox.md
Last active May 27, 2020 00:44
Ergodox買おうの会

この記事のあの画像を見てビビッと来てしまったので, 周りにいる人とErgodoxの購入検討をはじめました(随時更新)

購入できるところ

➜ FalbaTech

ErgoDox - FalbaTech

選んでいくスタイル。

@marchbold
marchbold / gcm.complete.json
Last active July 13, 2016 22:08
Complete GCM Payload using the Push Notifications ANE
{
"data" : {
"notification" : {
"icon" : "ic_stat_distriqt_default",
"alert" : "You have a notification",
"title" : "You have a notification",
"body" : "The body of the notification",
"sound" : "default",
"vibrate": "true",
"largeIcon": "assets/notifications/icons/largeIcon.png",
@tetsuharuohzeki
tetsuharuohzeki / rx_for_js_matomme.md
Last active August 4, 2018 06:46
RxJSのいろいろ雑感(2015年8月末編)

RxJSのいろいろ雑感(2015年8月末編)

  • Rx for JavaScriptについて、色々触った結論としてはこんな感じ
    • あくまでも現時点の感想なんで、そのうち認識が変わるかも
  • JavaScriptでRxを使う人ターゲットなんで、他の言語portにも効く話かはわからない

総論

気をつけること

@azu
azu / Incremental DOM.md
Last active July 13, 2022 16:07
Incremental DOM ざっと見たやつ。追記: 初期バージョンのコードなので最新では異なる場合があります。

Incremental DOM

Introducing Incremental DOM — Google Developers — Medium

Reactやvirtual-dom、Glimmer(Ember)などVirtual DOMの実装は色々あるが、これらのVirtual DOM実装には2つの問題がある

  • 既存のテンプレート言語を利用していない(しにくい)
  • モバイルでのパフォーマンス、特にメモリに関しては大きすぎる

これらを解決するためにIncremental DOMと言うものを作っている(WIP)

@brianburridge
brianburridge / gist:8d2755a73dd5b4f0332b
Created December 10, 2014 19:47
Export local db to JSON
namespace :json do
desc "Export all data to JSON files"
task :export => :environment do
Rails.application.eager_load!
ActiveRecord::Base.descendants.each do |model|
file = File.open(File.join(Rails.root, "db", "export", "#{model.table_name}.json"), 'w')
file.write model.all.to_json
file.close
end
@koba04
koba04 / api.md
Last active November 2, 2024 00:52
Vue.js note(v0.10.3). not translate. This is draft of https://github.com/koba04/vuejs-book .

API

Class: Vue

  • Vueはvue.jsのコアとなるコンストラクタ
  • インスタンスが作られたときにデータバインディングが開始される
  • オプションを取ることも出来て、DOMやデータやメソッドについて定義出来る
@ssig33
ssig33 / resque-kowareta.md
Last active March 18, 2022 02:46
Resque がぶっ壊れる話

起きたこと

Resque が謎の頓死を遂げる。 25 個とか起動してたはずのワーカーが気付いたら 0 個になってる。

対策

Resque のワーカー減らして daemon-spawn をやめて foreman + daemontools で resque を監視するようにした。

というだけではなんのこっちゃなので細かい話

Resque のワーカーがとにかく死にまくるのでなんなんだと思い調べていた。最初は monit とかで再起動させまくるかみたいに判断をする。この時点で Resque は daemon-spawn 経由で起動していた。

daemon-spawn 経由で起動している Resque のワーカーを monit で監視するというのは、大変に都合が悪い。複数あるワーカーのうちどれか一つが死んだみたいな場合でもまるごと再起動みたいな話になる。ならないかもしれないけど調べる時間の余裕がない(サービスに不具合があって金銭的な損害を垂れ流している状況なので)。