Skip to content

Instantly share code, notes, and snippets.

View vivalalova's full-sized avatar

Lova vivalalova

  • Taoyuan, Taiwan
  • 20:05 (UTC +08:00)
View GitHub Profile
SELECT *
FROM ${DB1}.drivers_ping a
WHERE EXISTS ( SELECT * FROM ${DB2}.village b WHERE st_contains(b.area, POINT(Y(a.location), X(a.location))) AND b.town = "南港區" )
and a.month = 5
and a.day = 14
GROUP BY uid
@vivalalova
vivalalova / twvillage.js
Last active September 21, 2018 03:51
convert GEO JSON to multi polygon
const countries = require('./countries.json')
const exec = async () => {
const connection = await pool.createConnection()
try {
for (const e of countries.features) {
let country
alias gl='git log --graph --oneline --decorate'
alias gs='git status'
alias greset='git reset --hard&&git clean -f'
@vivalalova
vivalalova / viewManager.swift
Created January 21, 2017 18:58
view manager
struct ViewManager {
static let rootViewController = UIApplication.sharedApplication().keyWindow?.rootViewController
static let statusBarHeight = UIApplication.sharedApplication().statusBarFrame.size.height
static var currentWindow: UIWindow? {
if let window = UIApplication.sharedApplication().keyWindow {
return window
} else {
@vivalalova
vivalalova / gist:cb15027e8ed7b86d5c8b10fe664be99c
Last active February 3, 2017 06:57
set sublime as default text editor on mac
defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.sublimetext.3;}'
//
// DirectionInfoView.swift
// DirectionAPP
//
// Created by Kuo-HsunShih on 2016/11/15.
// Copyright © 2016年 Lova. All rights reserved.
//
import UIKit
import YYWebImage
#if DEBUG
func Log( message: @autoclosure () -> String, filename: NSString = #file, function: String = #function, line: Int = #line) {
print("[\(filename.lastPathComponent):\(line)] %@", message())
}
#else
func dLog(@autoclosure message: () -> String, filename: NSString = #file, function: String = #function, line: Int = #line) {
}
#endif
Client.aggregate([{
"$lookup": {
"from": "badge",
"localField": "clientID",
"foreignField": "clientID",
"as": "test"
}
}]).exec(function(err, results) {
res.set({
'Content-Type': 'application/json',
//這樣storyboard沒反應,就不知道有這個view要render這樣
IB_DESIGNABLE
@protocol LOCircleProgressViewDelegate;
@interface LOCircleProgressView : UIView
////////////////////////////////////
//這樣就可以
@protocol LOCircleProgressViewDelegate;
IB_DESIGNABLE
@vivalalova
vivalalova / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console