Skip to content

Instantly share code, notes, and snippets.

Hiro Miyanishi hiromitz

Block or report user

Report or block hiromitz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hiromitz
hiromitz / s3link.php
Last active Aug 29, 2015
Generate Expiring Amazon S3 Link with Custom File Name
View s3link.php
@hiromitz
hiromitz / s3signurl.php
Created Nov 15, 2013
Generate Expiring Amazon S3 Link with Custom File Name
View s3signurl.php
$client = array(
'key' => '<key>',
'secret' => '<secret>'
);
$expires = 5; // In minutes
// output signed URL string
echo el_s3_getTemporaryLink($client['key'], $client['secret'], 'bucket', '<path:file-MD5>', '<filename>', $expires);
@hiromitz
hiromitz / jquery.plugin.js
Created May 13, 2011
jQuery Plugin Template
View jquery.plugin.js
;!function($) {
var pluginName = 'myPlugin';
$[pluginName] = function(el, op) {
this.options = op = $.extend({}, {
// default options here
}, op);
this.el = el;
};
View delegate.js
/**
* delegate
* @param {Object} o target object
* @param function m target method
*/
function delegate(o, m){
return function(){
return m.apply(o, arguments);
}
}
@hiromitz
hiromitz / alc-bookmarklet.js
Created Nov 26, 2010
bookmarklet for alc translation
View alc-bookmarklet.js
// javascript:
(function(w, d){
var t = (d.selection) ? d.selection.createRange().text :
(d.getSelection) ? d.getSelection() :
(w.getSelection) ? w.getSelection() : '';
(t == '') && (t = w.prompt('翻訳する文字を入力して下さい。', ''));
t ? w.open('http://eow.alc.co.jp/' + encodeURI(t) + '/UTF-8/', '_blank', '') : {};
})(window, document);
@hiromitz
hiromitz / rss.php
Created Nov 17, 2010
Simple RSS Reader
View rss.php
<?php
/**
* Simple RSS Reader
*/
$url = 'http://hiromitz.jimdo.com/rss/blog';
$rss = @simplexml_load_file($url);
foreach($rss->channel->item as $item) {
echo "<h2>". $item->title. "</h2>";
echo "<div>". $item->description. "</div>";
@hiromitz
hiromitz / rss4atom.php
Created Nov 17, 2010
Simple RSS Reader for ATOM
View rss4atom.php
<?php
/**
* Simple RSS Reader for ATOM
*/
$url = 'http://feeds.feedburner.com/github'; // feed url
$rss = @simplexml_load_file($url);
foreach($rss->entry as $entry) {
echo "<h2>". $entry->title. "</h2>";
@hiromitz
hiromitz / Abstract.php
Created Nov 16, 2010
Abstract Model class
View Abstract.php
<?php
/**
* Abstract Model class
*/
abstract class Abstract
{
/**
* stored values
View jquery.escapeHTML.js
;(function($){
$.escapeHTML = function(val) {
return $("<div/>").text(val).html();
};
})(jQuery);
You can’t perform that action at this time.