Skip to content

Instantly share code, notes, and snippets.

@jackypan1989
jackypan1989 / video.jsx
Created November 2, 2015 04:11 — forked from mikechau/video.jsx
videojs react component
var React = require('react');
var cx = require('classnames');
var vjs = require('video.js');
var _forEach = require('lodash/collection/forEach');
var _debounce = require('lodash/function/debounce');
var _defaults = require('lodash/object/defaults');
var DEFAULT_HEIGHT = 800;
var DEFAULT_WIDTH = 600;
var DEFAULT_ASPECT_RATIO = (9 / 16);

It's an article response to the article How it feels to learn JavaScript in 2016

Recently, we've heard too many terms in JS community in 2016. Why? So, let's talk about these.

Core Code

Who started the war? Angular 1.x

At first, it's just a small JS lib reinvented from jQuery to handle relationship among view, logic, and model. After that we found we don't need to write some shit and hard maintained codes in one single file with heavy logic. That's also what we called MVC or MVVM in front-end JS.

There is not only one to handle this problem, like backboneJS and emberJS. They all try to solve the potential problems when app getting bigger. But indeed Angular makes the front-end community hotter and started arguing the best practice.

@jackypan1989
jackypan1989 / webpack.common.js
Last active September 21, 2017 08:16
webpack migration (from v1 to v3)
const path = require('path')
const theme = {
'@form-item-margin-bottom': '12px',
'@layout-body-background': '#ffffff'
}
module.exports = {
resolve: {
modules: [
@jackypan1989
jackypan1989 / flolac18.hs
Last active June 6, 2018 02:12
Flolac 18 課前作業 (潘冠宇)
-- 1. Define a function called myFst which takes a tuple and returns the first component.
myFst :: (a, b) -> a
myFst = fst
-- 2. Define a function myOdd which determines if the input is an odd number or not.
myOdd :: Int -> Bool
myOdd x = x `mod` 2 == 1
-- 3. Consider the following function.
qs :: Ord a => [a] -> [a]
@jackypan1989
jackypan1989 / survey.js
Created September 13, 2018 09:34
分類
const difficulty = {
straight: '您牙齒的狀況在SOV隱形矯正的適應症範圍內,SOV已成功完成多例類似矯正病例',
convex: '您的牙齒問題相對比較複雜,使用SOV隱形矯正有一定難度,不過SOV已有成功矯正完成的病例了!',
concave: '您牙齒的狀況在SOV隱形矯正的適應症範圍內,SOV已成功完成多例類似矯正病例。'
}
const matrix = {
crowding: {
straight: '根據您牙齒擁擠錯位的情況,可以通過擴大牙弓或將牙齒寬度適度磨小,即能達到您排齊前牙,美觀牙齒的需求。',
convex: '通常情況下需要給一些牙齒瘦身 (專業稱鄰接面去釉),甚至需要拔牙才能獲得足夠空間來排齊牙齒、改善上顎牙齒前突情形。',