Skip to content

Instantly share code, notes, and snippets.

View hkitago's full-sized avatar

hkitago hkitago

  • Kawasaki
View GitHub Profile
@hkitago
hkitago / iCAL2iEPG.php
Last active March 3, 2019 23:41
for EyeTV 250 users in Japanese
<?php
/* Replace the URL / file path with the .ics url */
$file = "https://www.dropbox.com/s/xi4htg3cpo9eraz/FIFAWC2018_JA-JP.ics?dl=1";
/* Getting events from isc file */
$obj = new ics();
$icsEvents = $obj->getIcsEventsAsArray( $file );
/* Here we are getting the timezone to get the event dates according to gio location */
$timeZone = trim ( $icsEvents [1] ['X-WR-TIMEZONE'] );
unset( $icsEvents [1] );
@hkitago
hkitago / TWTR.js
Last active April 2, 2021 00:47
Bookmarklet for Twitter search
javascript:(()=>%7Bd=document,w=window,Qr=(w.getSelection?w.getSelection():d.getSelection?d.getSelection():d.selection.createRange().text);if(!Qr%7C%7CQr=='')%7Bvoid(Qr=prompt('Twitter%20search%20word:',''))%7Dif(Qr)w.open('https://twitter.com/search?q='+encodeURI(Qr))%7D)()
@hkitago
hkitago / EIJIRO.JS
Created August 1, 2018 04:45
Bookmarklet for EIJIRO.
javascript:(function()%7BQr=(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);if(!Qr%7C%7CQr=='')%7Bvoid(Qr=prompt('SPACE%20ALC%20search%20word:',''))%7Dif(Qr)window.open('http://eow.alc.co.jp/'+encodeURI(Qr));%7D)();
@hkitago
hkitago / GOOG.JS
Last active April 2, 2021 00:52
Bookmarklet for Google Search.
javascript:(()=>%7Bd=document,w=window,Qr=(w.getSelection?w.getSelection():d.getSelection?d.getSelection():d.selection.createRange().text);if(!Qr%7C%7CQr=='')%7Bvoid(Qr=prompt('Google%20search%20word:',''));%7Dif(Qr)w.open('https://www.google.com/search?q='+encodeURI(Qr))%7D)()
@hkitago
hkitago / iMsg.JS
Last active April 6, 2021 03:26
Bookmarklet to create a link with selected text or page title.
javascript:(()=>%7Blet%20d=document,t=window.getSelection?window.getSelection():(d.getSelection?d.getSelection():d.selection.createRange().text),s=((!t%7C%7Ct=='')?d.title:('%22'+t+'%22'))+'%20'+location.href;window.prompt('',s)%7D)()
@hkitago
hkitago / beep.js
Last active August 1, 2018 05:18
making beep sound.
const audioCtx = new(window.AudioContext || window.webkitAudioContext)();
const beep = function(){
if(settings.beep === 1) {
return false;
}
const volume = 0.1
, duration = 200
, type = 'square'
, frequency = 2000 /*1000*/;
@hkitago
hkitago / localization.js
Created August 1, 2018 05:28
module of dynamic import.
/*****************************************************************************
* Call in app.js like this:
*
* const localizeStrings = function(){
* import('./localization.js')
* .then(() => {
* const lang = settings.language === 'English' ? 'en' : localization.lang;
* if(localization.labelStrings[lang]) {
* document.getElementById('label0').textContent = localization.labelStrings[lang].label0;
* //updateBtnLabel.call(this);
@hkitago
hkitago / removeHeader.js
Last active April 2, 2021 00:51
Bookmarklet to remove header tag.
javascript:(()=>{d=document;d.head.parentNode.removeChild(d.head)})()
@hkitago
hkitago / createBlankHTML.JS
Created June 8, 2019 01:42
init page to rewrite.
(function(){window.addEventListener('load',function(){const d=document;while(d.body.firstChild){d.body.removeChild(d.body.firstChild)};while(d.head.firstChild){d.head.removeChild(d.head.firstChild)};}, {passive:false});})();
@hkitago
hkitago / ViewController.swift
Last active March 2, 2020 04:07
Fullscreen WKWebView for SPA
//
// ViewController.swift
// FullscreenWKWebView4SPA
//
// Created by Hiroyuki Kitago on 2017/10/26.
// Copyright © 2017年 Hiroyuki Kitago. All rights reserved.
//
import UIKit
import WebKit