$hoge = "abc";
if(0 == $hoge)
echo "true";
else
echi "false";
>> true
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
<? | |
/** $hoge を null にする */ | |
$hoge = null; | |
/** なぜかエラーにならずに stdClass が生成される */ | |
$hoge -> name = "naoto shingaki"; | |
$hoge -> age = 26; | |
/** stdClass は foreach でイテレーションできる */ |
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
#!/usr/bin/env ruby | |
hoge = 5 | |
fuga = if hoge > 3 | |
"big" | |
else | |
"small" | |
end | |
puts fuga #=> big |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
class Loto6 | |
{ | |
static void Main(string[] args) | |
{ | |
List<int> numbers = Enumerable.Range(1, 43).OrderBy(i => Guid.NewGuid()).Take(6).ToList(); | |
Console.Write(string.Join("-", numbers.ConvertAll<string>(delegate(int i) { return i.ToString(); }).ToArray())); |
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
/** | |
* JSON 形式のメッセージ配列を順に指定された id の要素内に表示する | |
* | |
* @param {array} messages JSON 配列 | |
* @param {integer} interval 表示時間(ms) | |
* @param {string} id 要素の id | |
*/ | |
module.notification = function(messages, interval, id) { | |
if (messages.length == 0) { | |
return; |
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
# -*- coding: utf-8 -*- | |
# ありがとう | |
#= 幸せを生むライブラリ | |
# | |
# Authors:: NaotoSHINGAKI | |
# Copyright:: Copyright (c) 2011 Naoto SHINGAKI <[email protected]> | |
# URL:: http://github.com/naoto | |
# Licence:: The MIT License. See LICENSE for details. | |
# |
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
gist.vim test |
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
Linux 2.6.18-164.15.1.el5.028stab068.9 (cake) 2011年06月22日 _i686_ (2 CPU) | |
10時15分45秒 LINUX RESTART | |
10時25分02秒 CPU %usr %nice %sys %iowait %steal %irq %soft %guest %idle | |
10時35分02秒 all 0.98 0.07 0.08 2.18 0.00 0.00 0.00 0.00 96.70 | |
10時35分02秒 0 0.90 0.08 0.09 2.60 0.00 0.00 0.00 0.00 96.34 | |
10時35分02秒 1 1.06 0.06 0.06 1.76 0.00 0.00 0.00 0.00 97.05 | |
10時45分01秒 all 0.97 0.07 0.08 1.95 0.00 0.00 0.00 0.00 96.92 | |
10時45分01秒 0 1.33 0.08 0.10 3.36 0.00 0.00 0.00 0.00 95.14 |
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
#!/usr/bin/env ruby | |
p [*1..43].shuffle[1..6]*'-' |