Skip to content

Instantly share code, notes, and snippets.

@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 / 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);
})();
// ==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 / 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}">
@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
/*
1. open member list and scroll to end of end.
2. exec this snippet in js console.
*/
var anc = document.getElementsByClassName("dUF9n");
var result = [];
for (var i=0;i<anc.length;i++){
result.push(anc[i].getAttribute("href"));
}
@ozero
ozero / iitc_flag_comm.user.js
Last active July 16, 2017 12:02
IITC plugin: flag comm as spam
// ==UserScript==
// @id iitc-plugin-flag-comm-as-spam
// @name IITC plugin: flag comm as spam
// @category Misc
// @version 0.1.0.20160831.120000
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL none
// @downloadURL none
// @description Flag spamming comm in 3 click.
// @include https://www.ingress.com/intel*
@ozero
ozero / post-comm-multiline.user.js
Last active January 22, 2022 04:11
IITC plugin: Post comm in multi-line
// ==UserScript==
// @id iitc-plugin-post-comm-multiline
// @name IITC plugin: Post comm in multiline
// @category Misc
// @version 0.2.0.20220122.02
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL none
// @downloadURL none
// @description Post comm in multiline
// @include https://*.ingress.com/*
$(".im_history_message_wrap").each(function(){
var el = $(this);
var date = $(".im_message_date",this).data('content');
var user = $(".im_message_author",this).text();
var reply_from = $(".im_message_reply_author span",this).text();
var reply = $(".im_message_reply_body .im_short_message_text",this).text();
reply = (reply != "")?"( " + reply_from + ": " + reply + " ) : " : "";
reply.replace(/\r/g, "");
reply.replace(/\n/g, "");
var body = $(".im_message_text",this).text();
@ozero
ozero / FxxK_UR_Bikeshed-discussion_language.swift
Created May 17, 2017 13:25
UIImageView cross-fade slideshow autoplay repeat sample in Swift 3 without rotten pods
class ViewController: UIViewController {
var imagesArraySlideshow : [UIImage] = []
var slideShowIndex:NSInteger = 0
var slideShowMax:NSInteger = 0
var ivSlideshow:UIImageView = UIImageView()
override func viewDidLoad() {
super.viewDidLoad()