テキトーに書いた。 Chromeでしか確認してない。
This file contains 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
function happyNewYear() { | |
alert('A Happy New Year'); | |
} |
This file contains 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
class Cat | |
def initialize | |
@word = 'にゃんにゃん' | |
end | |
def nyan | |
print @word | |
print "\n" | |
end | |
end |
This file contains 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
(1..100).each {|i| | |
if i % 15 == 0 then | |
p "Fizz Buzz" | |
elsif i % 5 == 0 then | |
p "Buzz" | |
elsif i % 3 == 0 then | |
p "Fizz" | |
else | |
p i | |
end |
This file contains 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
# -*- encoding: utf-8 -*- | |
# | |
# $ ruby tweet.rb hogehoge で投稿するよ | |
# | |
require "oauth" | |
require "twitter" | |
require "pp" | |
require "json" |
This file contains 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
@Override | |
public String toString() { | |
StringBuffer sb = new StringBuffer(); | |
sb.append(this.getClass().getSimpleName() + "["); | |
Class<?> clazz = this.getClass(); | |
while (clazz != null) { | |
Field[] fields = clazz.getDeclaredFields(); | |
for (Field field: fields) { | |
try { |
This file contains 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
private void debugCursor(Cursor c) { | |
if (c.moveToFirst()) { | |
do { | |
StringBuffer sb = new StringBuffer(); | |
sb.append("["); | |
for (int i = 0; i < c.getColumnCount(); i++) { | |
sb.append(c.getColumnName(i)); |
This file contains 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
/** | |
* 文字列処理クラス | |
* | |
*/ | |
public class StringUtil { | |
/** 半角スペース */ | |
private static final char SPACE_CHAR_HALF = ' '; | |
/** 全角スペース */ |
This file contains 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
#顔文字固定で色ランダム | |
PROMPT=$'%{\e[$[32+$RANDOM % 5]m%}(。◕‿◕。)%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' | |
#顔文字も色もランダム | |
FACE_CHAR=("(。◕‿◕。) " "(・∀・)ノ " "( ゚Д゚) " "(。╹ω╹。)" "♡♡♡♡" "☆☆☆☆") | |
PROMPT=$'%{\e[$[32+$RANDOM % 5]m%}$FACE_CHAR[$[$RANDOM % ${#FACE_CHAR[@]} + 1]]%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' |
This file contains 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
$('#target').bind('drop', function(e) { | |
// ドロップ |
OlderNewer