Skip to content

Instantly share code, notes, and snippets.

View hanfeisun's full-sized avatar
🏕️

Hanfei Sun hanfeisun

🏕️
View GitHub Profile
We can't make this file beautiful and searchable because it's too large.
b,25.8092,-80.24
b,25.8587,-80.2094
b,25.4849,-80.461
b,25.8471,-80.2415
b,25.6849,-80.3125
b,25.7502,-80.2429
b,25.6003,-80.3537
b,25.8306,-80.2661
b,25.926,-80.1617
b,25.9466,-80.2056
CREATE EXTENSION postgis;
SELECT postgis_full_version();
SELECT st_geomfromtext('POINT(-1 38)', 4329);
SELECT st_asewkt('0101000020E9100000000000000000F0BF0000000000004340');
SELECT st_geomfromtext('LINESTRING(-13 21,0 0,3 2)') AS mycheckmark;
CREATE EXTENSION postgis;
SELECT postgis_full_version();
SELECT st_geomfromtext('POINT(-1 38)', 4329);
SELECT st_asewkt('0101000020E9100000000000000000F0BF0000000000004340');
SELECT st_geomfromtext('LINESTRING(-13 21,0 0,3 2)') AS mycheckmark;
@hanfeisun
hanfeisun / gist:074f1d01c0e905a704aa
Last active August 29, 2015 14:20
install java8 on centOS
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.rpm
sudo rpm -i jdk-8u45-linux-x64.rpm
# Search jdk
rpm -qa|grep jdk
@hanfeisun
hanfeisun / gist:a266d0771402918d95fb
Created May 13, 2015 07:52
HowScalaFutureWorks.scala
import scala.concurrent._
import ExecutionContext.Implicits.global
import scala.concurrent.duration._
val is = 1 to 10 toList
def db = s"${Thread.currentThread}"
def f(i: Int) = Future {
println(db + s" -> \t I'm ${i} -> \t I start to sleep")
Thread.sleep(1*1000)
@hanfeisun
hanfeisun / gist:9f2a486f0c7f75d67ac3
Created May 13, 2015 08:02
HowScalaFutureWorksAdvance.scala
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")
// 能旋转的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 / dabblet.css
Last active September 9, 2015 09:38
Untitled
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;
<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>
<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>