Skip to content

Instantly share code, notes, and snippets.

@ozero
ozero / tmp.html
Last active May 24, 2016 00:58
Inject JS (with multibyte string) by js in a html
<html>
<head></head>
<body>
<!--
via:
"【JavaScript】window.btoa(‘日本語’) する at softelメモ"
https://www.softel.co.jp/blogs/tech/archives/4133
@ozero
ozero / MainPage.xaml
Last active May 21, 2016 03:35
How to inject userscript (IITC) into UWP WebView
<Page
x:Class="App1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App1"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
// ==UserScript==
// @id iitc-plugin-rgfx-dumpcomm@rgfx
// @name IITC plugin : Dump comm
// @category Tweaks
// @version 0.0.1.20150810.000000
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL
// @downloadURL
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
@ozero
ozero / IITC2GoogleMap.js
Last active August 29, 2015 14:18
Bookmarklet to open GoogleMap in current IITC view
javascript:(function(){
var e=$("a:contains('Permalink')");
setPermaLink(e);
var f=e.attr("href").replace(/.*?ll=(.*?),(.*?)&z=([0-9]+)/g,"https://www.google.co.jp/maps/@$1,$2,$3z?hl=ja");
window.open(f);
})();
@ozero
ozero / DamageReportExctract.php
Created March 10, 2015 00:24
extract from damage report html
<?php
/*
Ingress: extract portal name, lat&long, address, agent name and date
from html files of Ingress damage report email which exported
from thunderbird addon 'Import/Export tools'.
*/
$files=glob("./*/*.*");
$regx_agent="\sby\s.*?<span.*?>(.*?)<";
$regx_date="Date:\s</div>(.*?)<";
$regx_portal='em;"><div>(.*?)</div><div><a.*?pll=(.*?)&z=.*?>(.*?)</a></div>';
@ozero
ozero / iitc4webhub.user.js
Last active August 29, 2015 14:14
Run IITC userscript for WEBHUB iPhone app. #ingress
// ==UserScript==
// @name IITC
// @description Run IITC Bookmarklet
// @include https://www.ingress.com/intel*
// ==/UserScript==
var urls = ['total-conversion-build.user.js',
'plugins/portal-highlighter-high-level.user.js',
'plugins/player-tracker.user.js',
'plugins/show-less-portals-zoomed-out.user.js'];
@ozero
ozero / gist:7760c8fd616643272a85
Last active August 29, 2015 14:13
dump portal member
// add below at the end of window.plugin.keys.addToSidebar = function() { ... }
// https://secure.jonatkins.com/iitc/release/plugins/keys.user.js
var lv = [];
$("span.meter").each(function(index){
lv[index]= $(this).attr("title");
});
for(var i in lv){
var owner = lv[i].match(/owner:\t[\w]+/)
var level = lv[i].match(/level:\t[\w]+/)
console.log("pt("+i+"):\t"+owner+"\t"+level);
@ozero
ozero / mojie.php
Last active August 29, 2015 14:04
strangeworld [at]mojie ( http://mojie.s1.xrea.com/ ) archive parsing
<?php
//@文字絵小屋の過去ログを構造化してみる試み
main();
function main(){
$data = array();
遠藤会 - [360bpm] 健全ロボ ダイミダラー (crabMixx) ____ 260410-144085597
fhana - [99bpm] いつかの、いくつかのきみとのせかい (crabMixx) ____ 260408-143721890
内田真礼 - [205bpm] 創傷イノセンス (crabMixx) ____ 260404-143051765
blancmange - [138.75bpm] that's love that it is (crabMixx) ____ 260325-141242719
種ともこ - [68.92bpm] LOVE SONG (crabMixx) ____ 260319-140346965
NEW JACK拓郎 - [123.98bpm] 五星戦隊ダイレンジャー (crabMixx) ____ 260317-140008810
nonSectRadicals - [1bpm] 私の恋は1拍1分 ____ 260312-139225338
仲谷明香 - [175bpm] ハピネスチャージプリキュア!WOW! (crabMixx) ____ 260220-135804677
KMM団 - [81bpm] ウィッチ☆アクティビティ (crabMixx) ____ 260218-135427864
ゆず - [124bpm] REASON (crabMixx) ____ 260214-134781702
@ozero
ozero / AutoSize_Example.vba
Last active August 29, 2015 13:56
Powerpoint vba AutoSize_Example. For all TextShapes in all slides, all presentation windows, shrink font size to fit with textbox.
' mod from msdn http://msdn.microsoft.com/en-us/library/office/ff744773.aspx
Public Sub AutoSize_Example()
Dim prs As Presentation
Dim pptSlide As Slide
For Each prs In Presentations
Debug.Print prs.Name