This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var h = require('react-hyperscript'); | |
var Bacon = require('baconjs'); | |
// action | |
var action$ = new Bacon.Bus(); | |
function filterAction(action_type) { | |
return function(action) { | |
return action.type === action_type; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var $ = require('jquery'); | |
var h = require('react-hyperscript'); | |
var R = require('ramda'); | |
var V = require('promise-validate'); | |
var Bacon = require('baconjs'); | |
var validateUsername = V.pipe(V.isEmail('请输入邮箱'), V.isLength('最短4个字符,最长10个字符', 4, 10)); | |
var validateUsername$ = function(val) { | |
return Bacon.fromPromise(validateUsername(val)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'ht) | |
(require 'web) | |
(require 'dash) | |
(defun my-emacs-douban-play () | |
(interactive) | |
(web-http-get | |
(lambda (con header data) | |
;; local variables | |
(let* ((json (ht<-alist (json-read-from-string data))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.controller('CtrlImplAdvanced', ['$scope', '$controller', function ($scope, $controller) { | |
// Initialize the super class and extend it. | |
$.extend(this, $controller('CtrlImpl', {$scope: $scope})); | |
// … Additional extensions to create a mixin. | |
}]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -w | |
# -*- coding: UTF-8 -*- | |
# 去除UTF8文件开头的BOM信息 | |
# usage: cat file | ruby no-UTF8-BOM.rb | |
# or: ruby no-UTF8-BOM.rb file | |
content = '' | |
if ARGV.length > 0 then |