Skip to content

Instantly share code, notes, and snippets.

View KelvinJin's full-sized avatar
🎯
Focusing

Jin Wang KelvinJin

🎯
Focusing
  • Uthoft
  • Melbourne
View GitHub Profile
{
"tiles": [ "https://tiles.guildwars2.com/1/1/{z}/{x}/{y}.jpg" ],
"minzoom": 0,
"maxzoom": 7
}
@KelvinJin
KelvinJin / RoundedCornerLayer
Created March 23, 2015 01:33
Create your own rounded rect path with rounding corners.
//
// RoundedCornerLayer.swift
// OmnyStudio
//
// Created by Jin Wang on 20/03/2015.
// Copyright (c) 2015 121cast. All rights reserved.
//
import UIKit
@KelvinJin
KelvinJin / tracking.md
Last active August 28, 2015 06:26
Tracking Info

In order to enable xLabs Analytics to track your website, the following tracking script needs to be properly installed.

Note: Since our embedded javascript depends on jQuery 1.11.2+, you will need to import jQuery as well. However, most of the modern websites will have jQuery imported on every page. Here is a simple example of how jQuery is imported.
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>

The following is your tracking code. Copy and paste it into the code of every page you want to track.

<script type="text/javascript" src="http://xlabs-admin.uthoft.com/assets/js/xLabsAnalytics.js"></script>
@KelvinJin
KelvinJin / audioAds.xml
Created December 23, 2015 03:11
The xml file for audio ads. VAST format.
<VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="2.0">
<Ad id="2967">
<InLine>
<AdSystem>Mixberry Media</AdSystem>
<Impression>
http://imp.mixberrymedia.com/impressions/capture?parameters=4UV3V8gq_qFhxdSloAjDv2sFtu6uQta0vRQG7haMxCYjgvBFmZx0vphz4-SbbX4KW6OMs9BvMUaEBoSltBh1ETMvRb8qAj_w0vIRlPyNwm35i1v9AFfhz-U2joq7A1bT
</Impression>
<Creatives>
<Creative AdID="2967">
<Linear>
#EXTM3U
#EXT-X-TARGETDURATION:400
#EXT-X-VERSION:2
#EXTINF:400,
http://23.236.118.40/youku/657173189714584074FE8B3A8E/0300011A0057300714F2A2080D48DD530B3109-2D53-6FC6-5CBE-4C8E8B569BB0.flv.ts?ts_start=0&ts_end=400&ts_seg_no=0&ts_keyframe=1
#EXTINF:398,
http://23.236.118.40/youku/657173189714584074FE8B3A8E/0300011A0057300714F2A2080D48DD530B3109-2D53-6FC6-5CBE-4C8E8B569BB0.flv.ts?ts_start=400&ts_end=798&ts_seg_no=1&ts_keyframe=1
#EXT-X-ENDLIST
// XXNibBridge.m
// Version 2.2
//
// Copyright (c) 2015 sunnyxx ( http://github.com/sunnyxx )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@KelvinJin
KelvinJin / pi.swift
Last active September 5, 2016 13:10
Calculate Pi
import Foundation
srand48(Int(arc4random()))
func rand(from: Double, to: Double) -> Double {
assert(to - from > 0)
let seed = drand48()
return seed * (to - from) + from
}
<html>
<head>
<meta property="og:title" content="Introducing Amazon Echo">
<meta property="og:image" content="https://i.ytimg.com/vi/KkOCeAtKHIc/maxresdefault.jpg">
<meta property="og:description" content="Amazon Echo is always ready, connected, and fast. Just ask for information, music, news, weather, and more. Echo is controlled by your voice for hands-free c...">
<meta property="og:video" content="http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8">
论坛服务条款
一、用户守则
欢迎您加入『Phoenix』参加交流和讨论,『Phoenix』为公共论坛,为维护网上公共秩序和社会稳定,请您自觉遵守以下条款:
1. 互相尊重,遵守互联网络道德,遵守中华人民共和国的各项有关法律法规。
2. 承担一切因您的行为而直接或间接导致的民事、行政或刑事法律责任。
3. 不得发表违反中华人民共和国宪法和法律、违反改革开放和四项基本原则的言论。
4. 不得利用本论坛危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本论坛制作、复制和传播下列信息:
1) 不得发表反对宪法所确定的基本原则,煽动抗拒、破坏宪法和法律、行政法规实施的;
@KelvinJin
KelvinJin / SwiftyBus.swift
Last active October 19, 2016 06:32
A class written in Swift that simplifies how notification works in iOS.
class SwiftyBus {
private static let notificationQueue = DispatchQueue(label: "com.swiftybus.notification")
struct Observer {
let callback: Any
let queue: DispatchQueue
}
static let shared = SwiftyBus()