Skip to content

Instantly share code, notes, and snippets.

View cly's full-sized avatar

Charlie Liang Yuan cly

  • Lyft
  • San Francisco
View GitHub Profile
@cly
cly / LICENSE.txt
Created June 6, 2011 07:35 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
// validation mixin
var validation = {
getDefaultProps: function () {
return {
validate: []
}
}
, hasErrors: function () {
var errors = []
function OHLC(params) {
OHLC.prototype._init = function (params) {
this.height = params.height || 650;
this.width = params.width || 1300;
this.margin = params.margin || 50;
this.data = params.data;
this.movingAverageTypes = ['mov_avg_10d', 'mov_avg_50d', 'mov_avg_200d'];
this.dateFormat = d3.time.format("%Y-%m-%d");
@cly
cly / Animation.md
Created November 9, 2015 18:57 — forked from JeOam/Animation.md
iOS Core Animation: Advanced Techniques, Part 1: The Layer Beneath

1. The Layer Tree

Core Animation's original name is Layer Kit

Core Animation is a compositing engine; its job is to compose different pieces of visual content on the screen, and to do so as fast as possible. The content in question is divided into individual layers stored in a hierarchy known as the layer tree. This tree forms the underpinning for all of UIKit, and for everything that you see on the screen in an iOS application.

In UIView, tasks such as rendering, layout and animation are all managed by a Core Animation class called CALayer. The only major feature of UIView that isn’t handled by CALayer is user interaction.

There are four hierarchies, each performing a different role:

  • view hierarchy
  • layer tree
@cly
cly / index.html
Created November 25, 2017 18:42 — forked from ItsMeSousuke/d3_realtime_linechart.html
Realtime Line Chart with D3 v4
<style>
.axis {
font-family: sans-serif;
fill: #d35400;
font-size: 12px;
}
.line {
fill: none;
stroke: #f1c40f;