Skip to content

Instantly share code, notes, and snippets.

@baado
baado / てーねんぴっぴっぴー!
Created October 29, 2011 13:55
TPP→てーねんぴっぴっぴーなブックマークレット
javascript:(function(){var a=document.body.innerHTML;var b=['TPP','TPP'];var c='てーねんぴっぴっぴー';for(var i=0;i<b.length;i++){a=a.split(b[i]).join(c)}document.body.innerHTML=a})();
@baado
baado / ga_track_twitter.js
Created April 8, 2012 13:11
Tracking Twitter Widget Action with Google Analytics
var _ga = _ga || {};
var _gaq = _gaq || [];
_ga.trackSocial = function(opt_pageUrl, opt_trackerName) {
twttr.ready(function (twttr) {
_ga.trackTwitter(opt_pageUrl, opt_trackerName);
});
};
_ga.trackTwitter = function(opt_pageUrl, opt_trackerName) {
var trackerName = _ga.buildTrackerName_(opt_trackerName);
try {
@baado
baado / ga.js
Created April 30, 2012 07:04
Tracking Non-HTML Object with Google Analytics
var _gaq = _gaq || [];
// please replace 'UA-XXXXXX-X' to your analytics code.
_gaq.push(['_setAccount', 'UA-XXXXXX-X']);
_gaq.push(['_trackPageview']);
function recordObjectLink(link) {
try {
var linkedURL = link.href.replace('http://' + document.domain, '');
linkedURL = linkedURL.replace('https://' + document.domain, '');
@baado
baado / ga_track_js.js
Created May 20, 2012 02:57
Tracking JavaScript file loading time with Google Analytics
// Copyright 2012 Google Inc. All Rights Reserved.
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@baado
baado / objective_c_bookmarklet.js
Created June 14, 2012 01:38
@IT総合トップ > @IT CORE > Smart & Social > Objective-C初心者のためのiOS SDKコード例一覧だけのためのブックマークレット
javascript:(function(){var a=window.document.getElementById('centercol');a.style.width='auto';var b=a.getElementsByClassName('articleBox')[0];var c=b.getElementsByTagName('div');var d=c.length;for(i=0;i<d;i++){if(c[i].style.width=='480px')c[i].style.width='auto';}})();
//↓この記事を多少見やすくするためだけのブックマークレットです
//http://www.atmarkit.co.jp/fsmart/articles/iossdk_ref/01.html
//worked on
// Safari
// IE9(「javascript:」が勝手にちょん切られるので補完すべし)
// Opera
// Chrome(「javascript:」が勝手にちょん切られるので補完すべし)
//not worked on
// Firefox (何かセキュリティ設定がある?)
@baado
baado / modifier.format_byte.php
Created October 20, 2012 17:34
Smarty Byte Format Plugin
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifier
*/
/**
* Smarty format_byte modifier plugin
@baado
baado / OOFileManager.h
Created October 23, 2012 22:48
File Management Class
#import <Foundation/Foundation.h>
@interface OOFileManager : NSObject
+ (NSArray *)fileNames:(NSString *)fileName;
+ (BOOL)exists:(NSString *)fileName;
+ (BOOL)isDir:(NSString *)fileName;
+ (BOOL)resExists:(NSString *)fileName;
+ (void)makeDir:(NSString *)fileName;
+ (void)remove:(NSString *)fileName;