Skip to content

Instantly share code, notes, and snippets.

View rakuishi's full-sized avatar
🏠
Working from home

OCHIISHI Koichiro rakuishi

🏠
Working from home
View GitHub Profile
<?php
class RSS2 {
private $channel = array();
private $item = array();
public function setTitle($value) {
$this->channel['title'] = $value;
}
<?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 {
<!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 {
//
// UIView+EasyRectMake.m
//
// Created by OCHIISHI Koichiro on 2012/10/25.
//
//
#import "UIView+EasyRectMake.h"
@implementation UIView (EasyRectMake)
<?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)";
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
@rakuishi
rakuishi / friends.php
Created January 17, 2015 01:52
Show Twitter friend's last post datetime
<?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
# -*- coding: utf-8 -*-
# $ ruby tinypng.rb drawable/
require 'fileutils'
require 'net/https'
require 'uri'
API_KEY = '***'
i_dir = ARGV[0]
/*! 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);
# -*- coding: utf-8 -*-
require 'fileutils'
Dir.glob('content/archives/*.md').each do |filename|
content = File.open(filename).read;
content = content.gsub('<pre class="prettyprint">', '<pre><code>')
content = content.gsub('</pre>', '</code></pre>')
File.binwrite(filename, content)