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
// 清除空白、換行 | |
public static string clear(string text) | |
{ | |
var cls = new[] { "\r", "\n", " ", " " }; | |
foreach (var cl in cls) | |
{ | |
text = text.Replace(cl, string.Empty); | |
} | |
return text.Trim(); | |
} |
--
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
<?php | |
// https://developer.mozilla.org/zh-TW/docs/HTTP/Access_control_CORS | |
if (isset($_SERVER['HTTP_ORIGIN'])) { | |
header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}"); | |
header('Access-Control-Max-Age: 86400'); // day | |
header('Access-Control-Allow-Credentials: true'); | |
} | |
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { |
$ npm install -g typings
$ typings install dt~node dt~express --global --save
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
$.ajaxPrefilter((o) => { | |
if (o.type.toLowerCase() == 'post' && o.contentType.toLowerCase().includes('x-www-form-urlencoded')) { | |
var d = o.data.split('&'); // data | |
var i = $('input[name="__RequestVerificationToken"]:first'); // one | |
if (i.length > 0) { | |
var n = i.attr('name'); | |
var v = encodeURIComponent(i.val()); | |
var k = n + '=' + v; | |
d.push(k); | |
o.data = d.join('&'); |
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
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.util.AttributeSet; | |
import android.util.TypedValue; | |
public class MarqueeTextView extends android.support.v7.widget.AppCompatTextView { | |
private Paint paint = null; | |
private float x = 0.0f; | |
private float y = 0.0f; |