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() { | |
var elsWithId = document.querySelectorAll("*[id]"); | |
var IGNORE_TAGS = { | |
SCRIPT: true, | |
IFRAME: true | |
}; | |
for (var i = 0, len = elsWithId.length; i < len; ++i) { | |
var el = elsWithId[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
>>> $dt1 = new DateTime() | |
=> <DateTime #000000007766f6860000000009e51d7d> { | |
date: "2015-02-09 12:13:50", | |
timezone_type: 3, | |
timezone: "Asia\/Tokyo" | |
} | |
>>> $dt2 = new DateTime('@'.$dt1->getTimestamp()) | |
=> <DateTime #000000007766f6810000000009e51d7d> { | |
date: "2015-02-09 03:13:50", | |
timezone_type: 1, |
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
<?php | |
class Foo | |
{ | |
public $bar; | |
function __construct() | |
{ | |
$this->bar = 'bar'; | |
} |
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
{ | |
"name": "github.com/s-shin/sample", | |
"dependencies": [ | |
"github.com/gorilla/mux" | |
] | |
} |
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 perl | |
use strict; | |
use warnings; | |
use Term::ANSIColor; | |
use Term::ReadLine; | |
my $term = Term::ReadLine->new('pre-commit'); | |
BEGIN { | |
# STDOUTに吐いても良い気もするが、pre-commit.sampleがSTDERRに吐いているので |
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
fizzbuzz=(n)->["FizzBuzz",n,n,"Fizz",n,"Buzz","Fizz",n,n,"Fizz","Buzz",n,"Fizz",n,n][n%15] |
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
// | |
// Behavior of NSString with NULL character tail-padding. | |
// | |
// **I thought this behavior is wrong, but now, I see it's correct as NSString.** | |
// | |
// Usage: | |
// $ gcc nsstring-null-tail-padding.m -framework Foundation | |
// $ ./a.out | |
// | |
#import <Foundation/Foundation.h> |
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
package jp.hateblo.shin.hotentor.util; | |
import android.content.ActivityNotFoundException; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.pm.PackageManager; | |
import android.net.Uri; | |
import jp.hateblo.shin.hotentor.App; |
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
package jp.hateblo.shin.hotentor.util; | |
import android.annotation.TargetApi; | |
import android.graphics.drawable.Drawable; | |
import android.os.Build; | |
import android.util.TypedValue; | |
import android.view.View; | |
import jp.hateblo.shin.hotentor.App; |
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
package jp.hateblo.shin.hotentor.util; | |
import android.util.Log; | |
import jp.hateblo.shin.hotentor.BuildConfig; | |
/** | |
* ref: http://wada811.blogspot.com/2013/04/android-log-util.html | |
* Created by shin on 2014/08/30. | |
*/ |