This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class RSS2 { | |
private $channel = array(); | |
private $item = array(); | |
public function setTitle($value) { | |
$this->channel['title'] = $value; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once(dirname(__FILE__) . '/google-api-php-client/autoload.php'); | |
define('APPLICATION_NAME', '*'); | |
define('SERVICE_ACCOUNT_NAME', '*@developer.gserviceaccount.com'); | |
define('KEY_PATH', dirname(__FILE__) . '/p12/*.p12'); | |
date_default_timezone_set('Asia/Tokyo'); | |
class Analytics { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=2,user-scalable=yes" /> | |
</head> | |
<style type="text/css"> | |
body {margin:0;padding:0;background:#f0f0f0} | |
.wrapper {margin:0 auto;padding:24px;width:75%;background:#fff} | |
#scroll-to-top { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIView+EasyRectMake.m | |
// | |
// Created by OCHIISHI Koichiro on 2012/10/25. | |
// | |
// | |
#import "UIView+EasyRectMake.h" | |
@implementation UIView (EasyRectMake) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// データベース接続 | |
mysql_connect('localhost', 'root', 'root'); | |
mysql_select_db('database'); | |
mysql_query('SET NAMES UTF8'); | |
// テーブルが存在しない場合は作成する | |
if (mysql_query('SELECT 1 FROM kurage') == FALSE) { | |
$sql = "CREATE TABLE kurage (id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, name TEXT, sort INT UNSIGNED)"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once(dirname(__file__) . "/twitteroauth/twitteroauth.php"); | |
date_default_timezone_set('Asia/Tokyo'); | |
define('TWITTER_CONSUMER_KEY', '***'); | |
define('TWITTER_CONSUMER_SECRET', '***'); | |
define('TWITTER_ACCESS_TOKEN', '***'); | |
define('TWITTER_ACCESS_TOKEN_SECRET', '***'); | |
// https://dev.twitter.com/rest/reference/get/friends/list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# $ ruby wp-xml-hugo-import.rb ***.wordpress.yyyy-mm-dd.xml | |
require 'fileutils' | |
require 'time' | |
require 'rexml/document' | |
include REXML | |
class Time | |
def timezone(timezone = 'UTC') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# $ ruby tinypng.rb drawable/ | |
require 'fileutils' | |
require 'net/https' | |
require 'uri' | |
API_KEY = '***' | |
i_dir = ARGV[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! Table Expander jQuery Plugin | (c) 2014 rakuishi | MIT license */ | |
;(function($) { | |
$.fn.tableExpander = function(options) { | |
var defaults = { | |
'expandClassName' : 'expand', | |
'backgroundColor' : 'transparent', | |
'hoverBackgroundColor' : '#f0f0f0', | |
}; | |
var setting = $.extend(defaults, options); |
OlderNewer