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
tell application "Google Chrome" to set the bounds of the front window to {0, 0, 728, 546}
@rakuishi
rakuishi / deploy.sh
Created February 11, 2015 02:06
gh-pages
#!/bin/sh
git subtree push --prefix demo/ origin gh-pages
# -*- 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)
/*! 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 -*-
# $ ruby tinypng.rb drawable/
require 'fileutils'
require 'net/https'
require 'uri'
API_KEY = '***'
i_dir = ARGV[0]
@rakuishi
rakuishi / wp-xml-hugo-import.rb
Last active May 20, 2019 06:57 — forked from tnmt/wp-xml-octopress-import.rb
Import XML of Wordpress to Hugo
# -*- 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')
@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
<!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">
<?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)";
//
// UIView+EasyRectMake.m
//
// Created by OCHIISHI Koichiro on 2012/10/25.
//
//
#import "UIView+EasyRectMake.h"
@implementation UIView (EasyRectMake)