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
<%@tag pageEncoding="UTF-8" body-content="empty"%> | |
<%@tag import="java.util.Calendar"%> | |
<%@attribute name="year" type="Integer" required="true" rtexprvalue="true" %> | |
<%@attribute name="month" type="Integer" required="true" rtexprvalue="true" %> | |
<% | |
Calendar cal = Calendar.getInstance(); | |
cal.set(year, month - 1, 1); | |
int firstDayOfWeek = cal.get(Calendar.DAY_OF_WEEK); | |
int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH); |
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
<# | |
PowerShell Image module(http://archive.msdn.microsoft.com/PSImage/)のget-exif.ps1を改変して下記のプロパティを追加します。 | |
- Latitude (緯度。度表記) | |
- Longitude (経度。度表記) | |
- Name (ファイル名) | |
使用例 | |
dir "*.jpg" | get-exif | select name, latitude, longitude | export-csv out.csv | |
ライセンス |
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
# based on http://www.223soft.net/35 | |
class W | |
def initialize(opts) | |
@dest_dir = opts[:dest_dir] | |
end | |
def exec(cmd, md) | |
p = Pathname.new(@dest_dir + "/" + File.dirname(md[0])) | |
p.mkdir if not p.exist? |
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
=begin | |
適用方法 | |
1. Commands > HAML > Edit this bundle を開く | |
2. 出てきたプロジェクトのbundle.rbに main_menu.command 'Convert HAML to HTML' を追加する | |
3. このコードを commands/convert_haml_to_html.rb に保存する | |
4. Aptanaを再起動する | |
=end | |
require 'ruble' |
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
/** | |
* jQuery smoothScroll | |
* ページ内リンクをブラウザの挙動に近い形でスムーズにスクロールします。 | |
* | |
* # 使用例 | |
* $("a").smoothScroll(); | |
* $("a").smoothScroll({ duration: "fast", easing: "swing" }); | |
* | |
* # TODO | |
* - vertical-alignがtopでないimgを持つaに移動する際上部の位置がずれる点の修正 |
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
/** | |
* jQuery hoverOpacity | |
* hoverしたときにopacityを指定値まで段階的に変化させ、カーソルが離れたら1まで戻します。 | |
* | |
* # 使用例 | |
* $("a:has(img)").hoverOpacity(0.5); | |
*/ | |
(function($) { | |
var pluginName = "hoverOpacity"; | |
var plugin = function(value, options) { |
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
// Mathのstaticメンバを修飾なしで書けるようにします。 | |
import static java.lang.Math.*; | |
// System.outを修飾なしで書けるようにします。 | |
// outはPrintStreamのインスタンスなので | |
// import static java.lang.System.out.*; | |
// とはできないそうです。 | |
import static java.lang.System.out; | |
public class StaticImportExample { | |
public static void main(String[] args) { |
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 | |
$url = 'http://localhost/example/test.php'; // <?php var_dump($_POST) | |
$params = array('foo' => 'bar'); | |
$context = stream_context_create(array( | |
'http' => array( | |
'method' => 'POST', | |
'header' => 'Content-Type: application/x-www-form-urlencoded', | |
'content' => http_build_query($params, '', '&') | |
) |
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
using System; | |
using System.Text; | |
using System.Linq; | |
// C:\Program Files (x86)\Google\Google Data API SDK\Redist から参照します | |
using Google.GData.Client; | |
namespace Example | |
{ | |
static class BloggerPost | |
{ |
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
import java.util.List; | |
import java.util.ArrayList; | |
// http://d.hatena.ne.jp/t_yano/20080622/1214087678 | |
public class Example { | |
public static void main(String[] args) { | |
List<Person> list = new ArrayList<Person>() {{ | |
add(new Person(){{ name = "foo"; age = 20; }}); | |
}}; |