Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Hanfei Sun hanfeisun

🏠
Working from home
View GitHub Profile
@hanfeisun
hanfeisun / Mapbox demos
Last active January 19, 2017 04:26
mapboxDemos.md
View Mapbox demos
1. 自行车
https://www.mapbox.com/bites/00139/
2. 滚动
https://www.mapbox.com/bites/00110/
3. Quiz
@hanfeisun
hanfeisun / gist:ffa16659ffe5c4a45790
Last active December 25, 2015 07:02
关于OBD数据.md
View gist:ffa16659ffe5c4a45790

OBD

Speed (Vehicle speed - 车辆速度)

  • 单位: km/h
  • 数据范围: 0 ~ 255

RPM (Engine RPM - 发动机转速)

  • 单位: rpm
  • 数据范围: 0 ~ 16384
@hanfeisun
hanfeisun / designer.html
Last active November 11, 2015 10:29
designer
View designer.html
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
<style>
:host {
width: 100%;
@hanfeisun
hanfeisun / designer.html
Created November 11, 2015 09:45
designer
View designer.html
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
View squarespace全宽.html
<div style="position:relative; width: 100vw; left: calc(-50vw + 50%); background-image: url(https://waylens.squarespace.com/s/storage2.png);background-size:100%">
<img src="https://waylens.squarespace.com/s/storage2.png" style="visibility: hidden" />
</div>
View squarespace头部代码注入视频背景.html
<div style="position: fixed; z-index: 1000; width: 100%; height: 100%">
<iframe frameborder="0" height="100%" width="100%"
src="https://www.youtube.com/embed/aQsy17K84Ls?
autoplay=1&controls=0&showinfo=0&autohide=1&loop=1">
</iframe>
</div>
@hanfeisun
hanfeisun / dabblet.css
Last active September 9, 2015 09:38
Untitled
View dabblet.css
div.circle {
height: 134px;
width: 134px;
background-color: #000;
margin: 50vh auto 0;
transform: translateY(-50%);
border-radius: 50%;
animation-name: expand;
animation-duration: 2s;
animation-timing-function: ease-in;
View rotateMarker.js
// 能旋转的Marker类
L.RotatedMarker = L.Marker.extend({
options: {angle: 0},
_setPos: function (pos) {
L.Marker.prototype._setPos.call(this, pos);
if (L.DomUtil.TRANSFORM) {
// use the CSS transform rule if available
this._icon.style[L.DomUtil.TRANSFORM] += ' rotate(' + this.options.angle + 'deg)';
} else if (L.Browser.ie) {
// fallback for IE6, IE7, IE8
@hanfeisun
hanfeisun / gist:9f2a486f0c7f75d67ac3
Created May 13, 2015 08:02
HowScalaFutureWorksAdvance.scala
View gist:9f2a486f0c7f75d67ac3
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent._
import scala.concurrent.duration._
val is = 1 to 10 toList
def db = s"${Thread.currentThread}"
def f(i: Int) = {
val a = Future {
println(db + s" -> \t I'm ${i} -> \t I start to sleep")