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
| // http://stackoverflow.com/q/3454526 | |
| function getNodeXPath(node, prefix) { | |
| prefix = prefix ? prefix + ":" : ""; | |
| var getNodeName = function(node) { | |
| return { | |
| 1: prefix + node.nodeName.toLowerCase(), // instanceof Element | |
| 3: "text()" | |
| }[node.nodeType]; | |
| }; |
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
| package com.example.jsonrpc; | |
| import android.content.Context; | |
| import android.util.Log; | |
| import com.android.volley.AuthFailureError; | |
| import com.android.volley.Request; | |
| import com.android.volley.RequestQueue; | |
| import com.android.volley.Response; | |
| import com.android.volley.VolleyError; |
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
| 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. | |
| */ |
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
| 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 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
| 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 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
| // | |
| // 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 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
| fizzbuzz=(n)->["FizzBuzz",n,n,"Fizz",n,"Buzz","Fizz",n,n,"Fizz","Buzz",n,"Fizz",n,n][n%15] |
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
| #!/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 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
| { | |
| "name": "github.com/s-shin/sample", | |
| "dependencies": [ | |
| "github.com/gorilla/mux" | |
| ] | |
| } |
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 | |
| class Foo | |
| { | |
| public $bar; | |
| function __construct() | |
| { | |
| $this->bar = 'bar'; | |
| } |