Skip to content

Instantly share code, notes, and snippets.

View marsen's full-sized avatar
🕯️
Freedom

Marsen marsen

🕯️
Freedom
View GitHub Profile
@marsen
marsen / Big_Dropdownlist
Created July 21, 2016 09:53
Tampermonkey - 讓bitbucket開PR的時候完整顯示Branche資訊
// ==UserScript==
// @name Big Dropdownlist
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Marsen
// @match https://bitbucket.org/*/*/pull-requests/new
// @grant none
// ==/UserScript==
@marsen
marsen / FbShareLinkTest.html
Created May 20, 2016 07:35
Facebook Share Link Test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Facebook Share Link Test</title>
</head>
<body>
這裡有個圖片超聯結 <br>
<a target="_blank" href="http://www.facebook.com/share.php?u=www.google.com">
<img src="http://www.sasagrandic.com/webseite/wp-content/uploads/facebook-icon-300px.jpg" border="0" width="300" height="80"></a>
/*
** Copyright Microsoft, Inc. 1994 - 2000
** All Rights Reserved.
*/
SET NOCOUNT ON
GO
USE master
GO
@marsen
marsen / markTest.js
Created September 6, 2015 05:18
facebookQA
$(document).ready(function(){
$("#content").hide();
$("#content").fadeIn(2000);
$(".nav").hide();
$(window).scroll(function(){
if($(document).scrollTop()<7){
@marsen
marsen / sample.js
Last active August 29, 2015 14:20
CSharp Ticks to javascirpt time
//CSharp
new Date((cSharp.Ticks/10000) - 62135625600000),
@marsen
marsen / DateFormat.js
Created October 16, 2014 03:21
DateFormat.js
//擴充Date基本方法
Date.prototype.format = function (fmt) {
var opt = {
"M+": this.getMonth() + 1, //月
"d+": this.getDate(), //日
"h+": this.getHours(), //時
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"q+": Math.floor((this.getMonth() + 3) / 3), //季
"S": this.getMilliseconds() //毫秒
@marsen
marsen / Marsen.js
Last active August 29, 2015 14:06
Marsen Sandbox
//學習沙盒模式(Sandbox pattern)的範例
//順便整合一些之前常用的code,ex: 取亂數、取cookie等…
Marsen.modules = {} ;
Marsen.modules.web = function(box){
box.getQueryValue = function (name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
};//query string 取值
@marsen
marsen / getQueryValue.js
Created September 16, 2014 01:32
getQueryValue
function getQueryValue(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
@marsen
marsen / placeholder.html
Created August 6, 2014 06:00
placeholder html
<!DOCTYPE html>
<html>
<head runat="server">
<title></title>
<style>
input:focus::-webkit-input-placeholder { color:transparent; }
input:focus:-ms-input-placeholder { color:transparent; }
input:focus::-moz-placeholder { color:transparent; } /* FF 4-18 */
input:focus:-moz-placeholder { color:transparent; } /* FF 19+ */
</style>
@marsen
marsen / Module.html
Last active August 29, 2015 14:04
About javascript Module Pattern Sample
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript">
//#region
var MyModule = {};