Skip to content

Instantly share code, notes, and snippets.

View daipresents's full-sized avatar

Dai Fujihara daipresents

View GitHub Profile
@daipresents
daipresents / gist:7757017fff1b6c7658abfcfb242de83f
Created May 11, 2016 07:05
WordPressで「いいね!」や「つぶやき」をGoogle Analytics計測する方法
<script type="text/javascript" src="http://connect.facebook.net/ja_JP/all.js#xfbml=1&appId=アプリID"></script>
@daipresents
daipresents / gist:6111173f20e2a666c7d9d9a050c0938a
Created May 11, 2016 07:03
いいねボタンを非同期読み込みでスピードアップする
<!-- Facebook Scripts -->
<div id="fb-root"></div>
<script type="text/javascript">// <![CDATA[
window.fbAsyncInit = function() {
FB.init({
appId : 'アプリIDをここに書く', // ENTER your FB App ID
channelUrl : 'http://daipresents.com/channel.php', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
@daipresents
daipresents / gist:119881443e690c492a0d7b5deb6e1e1d
Created May 11, 2016 06:57
Javaで入力チェックに使える正規表現まとめ
^[a-zA-Z]+$
@daipresents
daipresents / gist:fa552e7061949badf3a70cc02d66870c
Created May 11, 2016 06:54
Maven2のdeployで「Error deploying artifact: Unsupported Protocol: 'dav': Cannot find wagon which supports the requested protocol: dav」
[WARN] repository metadata for: 'snapshot maven2sample:maven2sample:0.0.1-SNAPSHOT' could not be retrieved from repository: localhost.maven2 due to an error: Unsupported Protocol: 'dav': Cannot find wagon which supports the requested protocol: dav
[INFO] Repository 'localhost.maven2' will be blacklisted
org.apache.maven.plugin.MojoExecutionException: Error deploying artifact: Unsupported Protocol: 'dav': Cannot find wagon which supports the requested protocol: dav
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:195)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:578)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:508)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:328)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:151)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:220)
@daipresents
daipresents / gist:fc2ebedc3c2e4a53fbde369acd7c8c10
Created May 11, 2016 06:51
MacBook AirにSQLite+WEBRickで簡単にRedmineを動かす
sudo port install sqlite3
@daipresents
daipresents / gist:0bf9aa01fbdb38744e1122d0a89d8aef
Created May 11, 2016 06:50
Redmine BacklogsインストールでUnknown column 'issues.position'
ActiveRecord::StatementInvalid (Mysql::ServerError::BadFieldError: Unknown column 'issues.position' in 'order clause': SELECT `issues`.* FROM `issues` INNER JOIN `issue_statuses` ON `issue_statuses`.id = `issues`.status_id WHERE (
parent_id is NULL
and project_id = 1
and tracker_id in (5)
and fixed_version_id is NULL
and is_closed = 0) ORDER BY case when issues.position is null then 1 else 0 end ASC, case when issues.position is NULL then issues.id else issues.position end ASC):
vendor/plugins/redmine_backlogs/app/models/story.rb:38:in `backlog'
vendor/plugins/redmine_backlogs/app/models/story.rb:51:in `product_backlog'
vendor/plugins/redmine_backlogs/app/controllers/rb_master_backlogs_controller.rb:7:in `show'
@daipresents
daipresents / gist:89f68759e13c72ce2702529c1183976c
Created May 11, 2016 06:48
BacklogsプラグインをMac上のRedmineにインストール
sudo gem install rubygems-update -v=1.3.7
sudo gem uninstall rubygems-update # ここで古いrubygemsを消す
sudo sudo update_rubygems
@daipresents
daipresents / gist:68309216a979a68d30d5b39a5fef2270
Created May 11, 2016 06:45
Redmine+OSXでMysql::ProtocolError: invalid packet
ActionView::TemplateError (Mysql::ProtocolError: invalid packet: sequence number mismatch(98 != 1(expected)): SELECT * FROM `settings` WHERE (`settings`.`name` = 'app_title') LIMIT 1) on line #5 of app/views/layouts/base.rhtml:
@daipresents
daipresents / gist:cd8c75cbe343487bfa7968ee231b6589
Last active May 11, 2016 06:42
Redmineプラグインを作るなら読むべき本家チュートリアルの日本語訳
$ export RAILS_ENV="production"
@daipresents
daipresents / gist:9c605590d3c6bac93fd0d5a02988ca4c
Created May 11, 2016 06:30
TextMateがオープンソースになったのでMountain Lionに入れてみた
git clone https://github.com/textmate/textmate.git
cd textmate
git submodule update --init
./configure && ninja