This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function queryStringToJson(s="") | |
{ | |
return JSON.parse(s.replace(/[?|&]([A-Za-z0-9]*)=([^&]*)/ig, ",\"$1\":\"$2\"").slice(1).replace(/(.*)/, "{ $1 }")); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*----------------------------------------------------*/ | |
/* MOBILE DETECT FUNCTION | |
/*----------------------------------------------------*/ | |
var isMobile = { | |
Android: function() { | |
return navigator.userAgent.match(/Android/i); | |
}, | |
BlackBerry: function() { | |
return navigator.userAgent.match(/BlackBerry/i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ParsedUrl(url) { | |
this.parse(url); | |
} | |
ParsedUrl.prototype.parse = function (url) { | |
var parser = document.createElement("a"); | |
parser.href = url; | |
// IE 8 and 9 dont load the attributes "protocol" and "host" in case the source URL | |
// is just a pathname, that is, "/example" and not "http://domain.com/example". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// Modules | |
var webpack = require('webpack'); | |
var autoprefixer = require('autoprefixer'); | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
var CopyWebpackPlugin = require('copy-webpack-plugin'); | |
var _ = require('lodash'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>demo serializeArray of form to json object</title> | |
<script type="text/javascript" src="main.js"></script> | |
</head> | |
<body> | |
<form> | |
<input type="text" name="desc" value="demo serializeArray of form to json object."> | |
<input type="text" name="users[0].name" value="user A"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let _ = require('lodash'); | |
//Input | |
var input = [ | |
{ key: '1', val: 'a' }, | |
{ key: '2', val: 'b' }, | |
{ key: '3', val: 'c' } | |
]; | |
//Desired output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description jQuery-scroll-bottom。 | |
* | |
* 指定 selector 如果有捲軸時,當滑動至底部時觸發事件 | |
* @module ScrollBottom | |
* @author 許益銘 <mufasa.hsu@gmail.com> | |
* @example | |
* require('./jquery-scroll-bottom'); | |
* | |
* // method 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 這檔案是參考 https://forums.xamarin.com/discussion/21298/entrycell-password 並加以修正。 | |
* 主要是 xamarin 目前暫無密碼輸入的 EntryCell, | |
* | |
* 我增加的部份: | |
* 1. 建立 BindableProperty 讓 XAML 也可以使用 Value 屬性 | 2017.04 | |
*/ | |
using System; | |
using Xamarin.Forms; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:local="clr-namespace:App1" | |
x:Class="App1.AutoArrangement" | |
Title="Auto-Arrangement"> | |
<ContentPage.Content> | |
<local:GridListView |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:local="clr-namespace:App1.Pages" | |
x:Class="App1.CustomerPage"> | |
<Label Text="Say something here..."/> | |
</ContentPage> |