Skip to content

Instantly share code, notes, and snippets.

@pingyen
pingyen / jsIframe.html
Last active Aug 29, 2015
Put JS into Iframe
View jsIframe.html
<iframe id="_if1" scrolling="no" style="width : 100%" ></iframe>
<script>
(function() {
var oIf = document.getElementById('_if1'),
win = oIf.contentWindow,
doc = win.document;
doc.write('<html><head></head><body><script src="http://postpet.jp/webmail/blog/clock_v1_moco.js" ></sc' + 'ript><body></html>');
if(doc.all) {
var scArr = doc.getElementsByTagName('script'),
@pingyen
pingyen / jsIframe2.html
Last active Aug 29, 2015
Put JS into Iframe 2
View jsIframe2.html
<iframe id="_if2" scrolling="no" style="width : 100%" ></iframe>
<script>
(function() {
var oIf = document.getElementById('_if2'),
win = oIf.contentWindow,
doc = oIf.contentWindow.document;
doc.write('<html><head></head><body><script src="http://www.lucido-l.jp/blogparts/parts.js" ></sc' + 'ript>');
if(doc.all) {
@pingyen
pingyen / jsIframe3.html
Last active Aug 29, 2015
Put JS into Iframe 3
View jsIframe3.html
<iframe id="_if3" scrolling="no" style="width : 100%" ></iframe>
<script>
(function() {
var oIf = document.getElementById('_if3'),
win = oIf.contentWindow,
doc = oIf.contentWindow.document;
doc.write('<html><head></head><body><script> google_ad_client = "pub-1821434700708607"; google_ad_slot = "8156194155"; google_ad_width = 200; google_ad_height = 200; </sc' + 'ript><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></sc' + 'ript>');
if(doc.all) {
View plurkBot.php
<?php
define('NICKNAME', 'abc');
define('PASSWORD', 'iamabc');
define('USER_ID', '123456');
$message = 'Hello World!';
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
@pingyen
pingyen / jsFuncCall.html
Last active Aug 30, 2015
JavaScript Function Call Performance Test
View jsFuncCall.html
<html>
<head>
</head>
<body>
<script>
var i,
max = 10000000;
for(i = 0; i < max; ++i);
@pingyen
pingyen / plurkBot2.php
Last active Jun 29, 2017
Plurk Bot with Reply
View plurkBot2.php
<?php
define('NICKNAME', 'abc');
define('PASSWORD', 'iamabc');
define('USER_ID', '123456');
$message = 'Hello World!';
$reply = 'I am ABC!';
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@pingyen
pingyen / twd97Conv.php
Last active Nov 11, 2018
Transform TWD97 to Latitude Longitude
View twd97Conv.php
<?php
function twd97_to_latlng($x, $y) {
$a = 6378137.0;
$b = 6356752.314245;
$lng0 = 121 * M_PI / 180;
$k0 = 0.9999;
$dx = 250000;
$dy = 0;
$e = pow((1 - pow($b, 2) / pow($a, 2)), 0.5);
@pingyen
pingyen / base.js
Created Sep 20, 2012
WinJS base.js
View base.js
/// <loc filename="Metadata\base_loc_oam.xml" format="messagebundle" />
/*!
© Microsoft. All rights reserved.
This library is supported for use in Windows Store apps only.
Build: 1.0.9200.20498.win8_ldr.120817-1716
Version: Microsoft.WinJS.1.0
*/
@pingyen
pingyen / ui.js
Created Sep 20, 2012
WinJS.UI ui.js
View ui.js
This file has been truncated, but you can view the full file.
/// <loc filename="Metadata\ui_loc_oam.xml" format="messagebundle" />
/*!
© Microsoft. All rights reserved.
This library is supported for use in Windows Store apps only.
Build: 1.0.9200.20498.win8_ldr.120817-1716
Version: Microsoft.WinJS.1.0
@pingyen
pingyen / jsConsoleCustom.js
Last active Dec 11, 2015
JavaScript Console Customization
View jsConsoleCustom.js
(function() {
var arr = ['log', 'error', 'info', 'warn', 'trace'],
n = arr.length;
for(var i = 0; i < n; ++i) {
(function(k) {
var f = console[k];
console[k] = function() {
var arr = Array.prototype.slice.call(arguments);
You can’t perform that action at this time.