If you know all the properties that you want to place on a component a head of time, it is easy to use JSX:
var component = <Component foo={x} bar={y} />;Mutating Props is Bad, mkay
| #!/usr/bin/env ruby | |
| require 'webrick' | |
| require 'webrick/httpproxy' | |
| require 'RMagick' | |
| handler = Proc.new() { |req,res| | |
| if res['content-type'] =~ /image/ | |
| begin | |
| img = Magick::Image.from_blob(res.body).first |
| ;;; fgit.el --- Functional Git interface for emacs | |
| ;; Copyright (C) 2010 by Hayashi Masahiro | |
| ;; Author: Hayashi Masahiro <mhayashi1120@gmail.com> | |
| ;; URL: | |
| ;; Keywords: Emacs, Git, Frontend | |
| ;; Version: 0.0.1 | |
| ;; fgit.el is free software; you can redistribute it and/or modify | |
| ;; it under the terms of the GNU General Public License as published by |
| (require 'fringe-helper) | |
| (require 'flymake) | |
| (defvar flymake-fringe-overlays nil) | |
| (make-variable-buffer-local 'flymake-fringe-overlays) | |
| (defadvice flymake-make-overlay (after add-to-fringe first | |
| (beg end tooltip-text face mouse-face) | |
| activate compile) | |
| (push (fringe-helper-insert-region |
| ;; http://d.hatena.ne.jp/kitokitoki/20101009/p6 | |
| (defmacro grep-no-more-read-only (name) | |
| `(defadvice ,name (before ,(intern (concat "my-" (symbol-name name))) activate) | |
| "Prevent Buffer is read-only: #<buffer *grep*> error" | |
| (when (get-buffer "*grep*") | |
| (when (y-or-n-p "Kill current *grep* buffer?") | |
| (kill-buffer (get-buffer "*grep*")))))) | |
| (grep-no-more-read-only lgrep) |
| (when (require 'cl-indent-patches nil t) | |
| (setq lisp-indent-function | |
| (lambda (&rest args) | |
| (apply (if (memq major-mode '(emacs-lisp-mode lisp-interaction-mode)) | |
| 'lisp-indent-function | |
| 'common-lisp-indent-function) | |
| args)))) |
| #! /usr/bin/env ruby | |
| # vim: set et sts=2 sw=2 ts=2 fdm=marker ft=ruby : | |
| # author: takano32 <tak@no32 dot tk> | |
| # | |
| require 'rubygems' | |
| require 'pit' | |
| # ブラウザの起動とかを見えないようにできるけど、Xvfbとか必要 | |
| # Darwinじゃ使えないかもしれない。 |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Building a router</title> | |
| <script> | |
| // Put John's template engine code here... | |
| (function () { | |
| // A hash to store our routes: |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charst='utf-8'> | |
| <title>TEST</title> | |
| <script src="//code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script> | |
| <style> | |
| .box { | |
| background: #000000; | |
| display: none; |