Skip to content

Instantly share code, notes, and snippets.

View mak00s's full-sized avatar

Mak Shimizu mak00s

  • Tokyo, Japan / Draper, Utah
View GitHub Profile
@mak00s
mak00s / google-spreadsheet-dataTables.html
Last active July 19, 2018 15:03
Google SpreadsheetのデータをAPIで抽出してjQueryとdataTableでHTMLの表を作るJSスクリプト
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#example').dataTable({
"bServerSide": false,
"bProcessing": true,
"sAjaxDataProp": "feed.entry",
"sAjaxSource": "https://spreadsheets.google.com/feeds/list/[keyをここへ]/od6/public/values?alt=json",
"aoColumns": [{
@mak00s
mak00s / itunes-auto-link-maker-tag
Last active May 6, 2018 05:32
iTunesのAuto Link Makerのタグを改善した例
@mak00s
mak00s / erase-url-parameter-scode2.js
Created November 5, 2017 11:10
キャンペーン用URLパラメータをキレイにする(s_code.js)part 2 of 2
// s.t();の後に下記を追加する
if (location.hash && location.hash.match(/#cid=.+/)) {
if ('replaceState' in history)
history.replaceState('', document.title, location.pathname + location.search);
else window.location.hash = '';
}
@mak00s
mak00s / erase-url-parameter-scode1.js
Created November 5, 2017 11:08
キャンペーン用URLパラメータをキレイにする(s_code.js)part 1 of 2
// パラメータ名「cid」の部分は適宜変更
s.campaign = getHashQueryParam('cid');
// クエリにも同時対応する場合は以下のように書ける
s.campaign = s.getQueryParam('cid') || s.getHashQueryParam('cid');
@mak00s
mak00s / erase-url-parameter-gaq.js
Last active May 6, 2018 05:32
キャンペーン用URLパラメータをキレイにする(ga.js)
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_setAllowAnchor', true]);
_gaq.push(function(){
if (location.hash && location.hash.match(/(#|&)(utm_source|__utma)=.+/)) {
if ('replaceState' in history)
history.replaceState('',document.title, location.pathname + location.search);
else location.hash = '';
}
});
_gaq.push(['_trackPageview']);