Skip to content

Instantly share code, notes, and snippets.

View alalwww's full-sized avatar
(‘、3_ヽ)_

alalwww alalwww

(‘、3_ヽ)_
View GitHub Profile
@alalwww
alalwww / twitter.html
Last active December 30, 2015 17:19
Octopressの twitter aside がAPI1.0系のもので、表示できなくなっているのでTLウィジェットとツイートボタンでそれっぽいのを作成しました。フォローボタンはインラインスタイルで適当に位置調整しています。aside作成の参考までに。(このままコピっても使えないです。ツイッター公式でタイムラインウィジェットを作成してカスタマイズしてください。)
<section style="position:relative">
<h1>Twitter</h1>
<div style="position:absolute;top:0;right:16px">
<a href="https://twitter.com/alalwww" class="twitter-follow-button" data-show-count="false" data-lang="ja" data-show-screen-name="false">Follow @alalwww</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
<div>
<a class="twitter-timeline" href="https://twitter.com/alalwww" data-widget-id="408658474638118912" data-chrome="noheader nofooter transparent" data-lang="ja">@alalwww からのツイート</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
@alalwww
alalwww / gist:7693440
Last active December 29, 2015 15:49
抽象化
public abstract class AbstractShachiku implements Runnable
{
protected asbtract void work();
@Override
public final void run()
{
syukkin();
}
/*
* SpawnChecker
*
* (c) 2013 alalwww
* https://github.com/alalwww
*
* This mod is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL.
* Please check the contents of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt
*
* この MOD は、Minecraft Mod Public License (MMPL) 1.0 の条件のもとに配布されています。
public class Main {
public static main(String... args) {
Map<Integer, Map<Position, Box>> backingMap = Maps.newHashMap();
Supplier<Map<Position, Box>> factory = newMapFactory();
Table<Integer, Position, Box> table = Tables.newCustomTable(backingMap, factory);
Integer rowKey = 0;
Position columnKey = getPosition();
@alalwww
alalwww / article.html
Last active December 13, 2015 21:48
indexページに表示されないよう、sharing.html の読み込み位置を7行目に変更した。
{% unless page.no_header %}
<header>
{% if index %}
<h1 class="entry-title"><a href="{{ root_url }}{{ post.url }}">{% if site.titlecase %}{{ post.title | titlecase }}{% else %}{{ post.title }}{% endif %}</a></h1>
{% else %}
<h1 class="entry-title">{% if site.titlecase %}{{ page.title | titlecase }}{% else %}{{ page.title }}{% endif %}</h1>
{% include post/sharing.html %}
{% endif %}
{% unless page.meta == false %}
<p class="meta">
@alalwww
alalwww / sharing.html
Created February 18, 2013 18:33
ツイートボタンのあとに、source/_includes/post/sharing.html にはてなブックマーク追加ボタンを追加。
<div class="sharing">
{% if site.twitter_tweet_button %}
<a href="http://twitter.com/share" class="twitter-share-button" data-url="{{ site.url }}{{ page.url }}" data-via="{{ site.twitter_user }}" data-counturl="{{ site.url }}{{ page.url }}" >Tweet</a>
{% endif %}
{% if site.hatena_bookmark_button %}
<a href="http://b.hatena.ne.jp/entry/{{ site.url }}{{ page.url }}" class="hatena-bookmark-button" data-hatena-bookmark-layout="simple-balloon" title="このエントリーをはてなブックマークに追加"><img src="http://b.st-hatena.com/images/entry-button/button-only.gif" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border: none;" /></a><script type="text/javascript" src="http://b.st-hatena.com/js/bookmark_button.js" charset="utf-8" async="async"></script>
{% endif %}
{% if site.google_plus_one %}
<div class="g-plusone" data-size="{{ site.google_plus_one_size }}"></div>
{% endif %}
@alalwww
alalwww / aboutmetwitter.html
Created February 18, 2013 18:17
https://github.com/dharFr/octo-about-me-from-twitter を自分用にカスタマイズ。 ロード前から site.description 削除してツイッターから取得してるよメッセージに変更。ツイッターから取得した location と description の文字サイズを小さくなるように変更。locationのあとにフォローボタンを追加。 スタイルをインライン指定してたり改行なしでHTMLつっこんでたりと超手抜き仕様。 作成したファイルは source/_includes/custom/asides/aboutmetwitter.html に配置して使う。
{% if site.twitter_user %}
<section>
<h1>About Me</h1>
<div id="twitter-profile" style="margin-top:0.5em;">
<p>
<strong>{{site.author}}</strong>
(<a href="http://twitter.com/{{site.twitter_user}}">@{{ site.twitter_user }}</a>)
</p>
<p>Getting profile from Twitter...</p>
</div>
@alalwww
alalwww / gist:3994923
Created November 1, 2012 16:41
ItemFinder
public static <I extends Item> I findItemByName(String targetName)
{
if (!targetName.startsWith("item."))
{
targetName = "item." + targetName;
}
for (Item item : Item.itemsList)
{
if (item == null || item.getItemName() == null)