Skip to content

Instantly share code, notes, and snippets.

View minoritea's full-sized avatar

Minori Tokuda minoritea

View GitHub Profile
@muga
muga / gist:1119814
Created August 2, 2011 08:23
protobuf, thrift, kryo & msgpack
create ser +same deser +shal +deep total size +dfl
kryo 98 1463 1375 1849 1878 2013 3476 233 147
protobuf 193 2649 1305 1388 1449 1666 4315 239 149
thrift 188 2802 2635 1722 1781 1849 4651 349 197
msgpack 102 1652 1558 1758 1998 1921 3573 233 146
msgpack-manual 101 1602 1389 1694 1757 1868 3470 233 146
@tily
tily / scaling_isomorphic_javascript_code.ja.markdown
Last active May 1, 2023 09:03
サバクラ両方で動く JavaScript の大規模開発を行うために

サバクラ両方で動く JavaScript の大規模開発を行うために

原文:Scaling Isomorphic Javascript Code (This is just for study, please contact me at tily05 atmark gmail.com if any problem.)

考えてみれば Model-View-Controller とか MVC ってよく聞くよね。実際どんなものか知ってる? 抽象的に言うなら「オブジェクト情報の保持されるグラフィック・システム (つまり、ラスターではないグラフィック。ゲームとか) 上に構築された、表示系を中心としたアプリケーションにおいて、主要な機能どうしの関わりをうまく分離すること」とでも言おうか。もう少し深く考えを押し進めてみれば、これは当然、他のさまざまなアプリケーションにもあてはまる言葉 (bucket term ?) だ。

過去に多くの開発コミュニティが MVC による解決案を提供し、それによってよくあるユースケースにうまく対処し、地位を築くことができた。例をあげるなら、Ruby や Python コミュニティは Rails や Django を作り、MVC アーキテクチャを実現した。

@kwatch
kwatch / gist:2814940
Created May 27, 2012 16:18
Rubyの特殊変数一覧
$! raise された例外オブジェクト
$" require で読み込まれたファイルの配列
$#
$$ 現在のプロセス ID
$%
$& 正規表現にマッチした箇所の文字列
$' 正規表現にマッチした箇所より後ろの文字列
$(
$)
$* Ruby スクリプトに指定された引数。ARGV と同じ
module ActionController
module Streaming
extend ActiveSupport::Concern
protected
# Set proper cache control and transfer encoding when streaming
def _process_options(options) #:nodoc:
super
if options[:stream]
@endorama
endorama / angular-loadscript.js
Last active October 11, 2018 07:28
AngularJS 1.2.0 lazy load script in partials
/*
* Angular LoadScript
*
* Let angular load and execute lazy javascript from partials!
*
* This module is the result of this issue: "1.2.0rc1 regression: script tags not loaded via ngInclude"
* Issue url: https://github.com/angular/angular.js/issues/3756
*
* As of Angular 1.2.0 the ngInclude scripts does not permit execution of javascript from included partials.
* This little module execute code inside script tags with "javascript-lazy" attribute after partial loading,
@petehunt
petehunt / React sortable
Created December 9, 2013 22:30
Here's an example of React + jQuery UI sortable. The key thing to note is that we have the render() method do absolutely nothing and use componentDidUpdate() + React.renderComponent() to proxy updates through to the children. This lets us manage the DOM manually but still be able to use all the React goodies you know and love.
<html>
<head>
<title>Test</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://fb.me/react-0.5.1.js"></script>
<script src="http://fb.me/JSXTransformer-0.5.1.js"></script>
</head>
@subudeepak
subudeepak / angular-loadscript-with-documentwrite.js
Last active May 5, 2020 03:16 — forked from endorama/angular-loadscript.js
Loading scripts on ngInclude (ng route) - Script loading directive
/**
* This module is a variant which supports document.write. If you need document.write use this instead
* Author: Deepak Subramanian @subudeepak(https://github.com/subudeepak)
* Distributed under MIT License
*/
/*global angular */
(function (ng) {
'use strict';
app.directive('script', function() {
return {
@ryan5500
ryan5500 / ssh_wifi.rb
Created April 17, 2014 12:16
WAPM-APG300N / WAPM-AG300Nの設定コマンド入力を自動化するスクリプト
#!/usr/bin/env ruby
#
# Buffalo WAPM-APG300N / WAPM-AG300Nの設定を自動化するスクリプト
# sshでルーターに接続し、 コマンドを実行する。
#
require 'net/ssh'
host = ARGV[0] # ホスト名
@noexpect
noexpect / books_update.py
Last active August 29, 2015 14:00
本日発売のコミックを毎日htmlメールでお知らせ pythonでBeautifulSoupとmailコマンド on Amazon Linux
# -*- coding:utf-8 -*-
import codecs
import sys
reload(sys)
sys.setdefaultencoding('shift_jis')
from BeautifulSoup import BeautifulSoup
import urllib2
import re
class scrape_web:
@richp10
richp10 / gist:1c367d3c67aec762788e
Created May 10, 2014 10:19
Secure iptables configuration for coreos ??
// This systemd runs iptables-restore on boot:
[Unit]
Description=Packet Filtering Framework
DefaultDependencies=no
After=systemd-sysctl.service
Before=sysinit.target
[Service]
Type=oneshot
ExecStart=/usr/sbin/iptables-restore /opt/docker/scripts/iptables/iptables.rules